1.使用ECharts制作图表

https://www.runoob.com/echarts/echarts-install.html

官网:https://echarts.apache.org/zh/index.html

  • 完全版:echarts/dist/echarts.js,体积最大,包含所有的图表和组件,所包含内容参见:echarts/echarts.all.js
  • 常用版:echarts/dist/echarts.common.js,体积适中,包含常见的图表和组件,所包含内容参见:echarts/echarts.common.js
  • 精简版:echarts/dist/echarts.simple.js,体积较小,仅包含最常用的图表和组件,所包含内容参见:echarts/echarts.simple.js

    1.1 配置语法

    创建一个 HTML 页面,引入 echarts.min.js:

    1. <!DOCTYPE html>
    2. <html>
    3. <head>
    4. <meta charset="utf-8">
    5. <!-- 引入 ECharts 文件 -->
    6. <script src="echarts.min.js"></script>
    7. </head>
    8. </html>

    第二步: 为 ECharts 准备一个具备高宽的 DOM 容器

    实例中 id 为 main 的 div 用于包含 ECharts 绘制的图表:

    1. <body>
    2. <!-- 为 ECharts 准备一个具备大小(宽高)的 DOM -->
    3. <div id="main" style="width: 600px;height:400px;"></div>
    4. </body>

    第三步: 设置配置信息

    ECharts 库使用 json 格式来配置。

    1. echarts.init(document.getElementById('main')).setOption(option);

    这里 option 表示使用 json 数据格式的配置来绘制图表。步骤如下:

    标题

    为图表配置标题:

    1. title: {
    2. text: '第一个 ECharts 实例'
    3. }

    提示信息

    配置提示信息:

    1. tooltip: {},

    图例组件

    图例组件展现了不同系列的标记(symbol),颜色和名字。可以通过点击图例控制哪些系列不显示。

    1. legend: {
    2. data: [{
    3. name: '系列1',
    4. // 强制设置图形为圆。
    5. icon: 'circle',
    6. // 设置文本为红色
    7. textStyle: {
    8. color: 'red'
    9. }
    10. }]
    11. }

    X 轴

    1. 配置要在 X 轴显示的项:
    2. xAxis: {
    3. data: ["衬衫","羊毛衫","雪纺衫","裤子","高跟鞋","袜子"]
    4. }

    Y 轴

    配置要在 Y 轴显示的项。

    1. yAxis: {}

    系列列表

    每个系列通过 type 决定自己的图表类型:

    1. series: [{
    2. name: '销量', // 系列名称
    3. type: 'bar', // 系列图表类型
    4. data: [5, 20, 36, 10, 10, 20] // 系列中的数据内容
    5. }]

    每个系列通过 type 决定自己的图表类型:

  • type: ‘bar’:柱状/条形图

  • type: ‘line’:折线/面积图
  • type: ‘pie’:饼图
  • type: ‘scatter’:散点(气泡)图
  • type: ‘effectScatter’:带有涟漪特效动画的散点(气泡)
  • type: ‘radar’:雷达图
  • type: ‘tree’:树型图
  • type: ‘treemap’:树型图
  • type: ‘sunburst’:旭日图
  • type: ‘boxplot’:箱形图
  • type: ‘candlestick’:K线图
  • type: ‘heatmap’:热力图
  • type: ‘map’:地图
  • type: ‘parallel’:平行坐标系的系列
  • type: ‘lines’:线图
  • type: ‘graph’:关系图
  • type: ‘sankey’:桑基图
  • type: ‘funnel’:漏斗图
  • type: ‘gauge’:仪表盘
  • type: ‘pictorialBar’:象形柱图
  • type: ‘themeRiver’:主题河流
  • type: ‘custom’:自定义系列

    实例

    以下为完整的实例:

    1. <!DOCTYPE html>
    2. <html>
    3. <head>
    4. <meta charset="utf-8">
    5. <title>第一个 ECharts 实例</title>
    6. <!-- 引入 echarts.js -->
    7. <script src="https://cdn.staticfile.org/echarts/4.3.0/echarts.min.js"></script>
    8. </head>
    9. <body>
    10. <!-- 为ECharts准备一个具备大小(宽高)的Dom -->
    11. <div id="main" style="width: 600px;height:400px;"></div>
    12. <script type="text/javascript">
    13. // 基于准备好的dom,初始化echarts实例
    14. var myChart = echarts.init(document.getElementById('main'));
    15. // 指定图表的配置项和数据
    16. var option = {
    17. title: {
    18. text: '第一个 ECharts 实例'
    19. },
    20. tooltip: {},
    21. legend: {
    22. data:['销量']
    23. },
    24. xAxis: {
    25. data: ["衬衫","羊毛衫","雪纺衫","裤子","高跟鞋","袜子"]
    26. },
    27. yAxis: {},
    28. series: [{
    29. name: '销量',
    30. type: 'bar',
    31. data: [5, 20, 36, 10, 10, 20]
    32. }]
    33. };
    34. // 使用刚指定的配置项和数据显示图表。
    35. myChart.setOption(option);
    36. </script>
    37. </body>
    38. </html>

    1.2 饼图

2.XPATH

第一步:创建 HTML 页面

https://www.baidu.com/link?url=52rkaTKE-Bfj3Sz4aOo-17TYpNfmdW3ovFX3LAWEWpz9dXIy9GCmgjfzMQ_cvbQWTavcMpU9adLFulGXUccEaa&wd=&eqid=b62a1003000060d600000002608689af
https://www.baidu.com/link?url=IMMTK8dYoMKr0klvgxNhFf1LUa_hPm741unm0zgwiKRQbkziRisyKM8y4tbQO8USxlDtDVZBJqZbcE4o0oYyXFjRGjfxqbnOkT4JZgCTw2u&wd=&eqid=fb430cd900051636000000026088f0d5

2.1 获取指定网址的html字符串

2.2 利用tinypath库进行解析

3. Qt中嵌入外部exe

我想用此方法使得64位的程序得以调用32位的外部程序!

4. jquery

3.Qtpdfium

https://github.com/paulovap/qtpdfium

QtPdfium is a Qt module that renders PDF files using the pdfium project by google. It render PDF pages into QImage.

3.1 Installation

只有UNIX版本,oh,no!
To use the library you must first install it in the same location as your Qt installation. Here is an example on Linux/Mac:

recursive :就是项目里包含的一些库或者一些模块是存在了别的仓库,可以用递归来克隆回来。一次性就能解决所有的依赖模块

git clone —recursive https://github.com/paulovap/qtpdfium
cd qtpdfium
qmake
make
make install (might need sudo)
After that you are ready to use it. Remember to build for each platform you want. (Desktop, Android, iOS…)

3.2 Usage

The API consists in only two classes: QPdfium and QPdfiumPage.

To load a PDF file, simply do:

include

QPdfium pdf(“mypdf.pdf”);
qDebug() << pdf.isValid(); //should return true
You can get the number of pages with QPdfium::pageCount()

You can access pages by index:

include

QPdfium pdf(“mypdf.pdf”);
QPdfiumPage page = pdf.page(0);
qDebug() << page.width(); // should show something!
To generate the image:

include

QPdfium pdf(“mypdf.pdf”);
QPdfiumPage page = pdf.page(0);
QImage image = page.image(3); //renders it 3 times bigger
And for extracting text:

include

QPdfium pdf(“mypdf.pdf”);
QPdfiumPage page = pdf.page(0);
QString pageText = page.text();
Note: On iOS you need to initialize QtPdfium manually since it is statically linked. Just create a global object like this:

ifdef Q_OS_IOS
//Since it’s static library on IOS we need to initialize it by hand
PdfiumGlobal global;
#endif
And that’s it.

Future work
Load pdf with encryption (passwords)
Text manipulation (find, extract, cursor..)
Partial rendering
Render to other devices (gl surface, so on..)
Contributing
Feel free to help. :)

License
BSD