Highcharts

Highcharts项目实战(三)

爷,独闯天下 提交于 2020-01-25 07:33:28
Highcharts配置 之前已经将Highcharts的大致操作都讲了一遍,现在我来介绍下Highcharts的参数配置。 属性和事件 以下主要参考[参数配置](https://www.runoob.com/highcharts/highcharts-setting-detail.html) chart.events.addSeries:添加数列到图表中。 // // chart.events.click:整个图表的绘图区上所发生的点击事件。 // // chart.events.load:图表加载事件。 // // chart.events.redraw:图表重画事件,当点击图注显示和隐藏绘图时可以触发。 // // chart.events.selection:当图表曲线可选择放大时,当选择图表操作时,可以触发该事件。 // // chart.height:所绘制图表的高度值。 // // chart.inverted:图表中的x,y轴对换。 // // chart.polar:是否为极性图表。 // // chart.reflow:当窗口大小改变时,图表宽度自适应窗口大小改变。 // // chart.renderTo:图表加载的位置,是页面上的一个DOM对象。 // // chart.showAxes:在空白图表中,是否显示坐标轴。 // // chart.type

HighCharts入门

[亡魂溺海] 提交于 2020-01-25 06:37:52
Highcharts摘要 HighCharts是一款纯javascript编写的图表库,是目前最为流行的图表插件,应用范围广泛, 目前支持直线图、曲线图、面积图、曲线面积图、面积范围图、曲线面积范围图、柱状图、柱状范围图、条形图、饼图、散点图、箱线图、气泡图、误差线图、漏斗图、仪表图、瀑布图、雷达图,共18种类型图表。由于其功能强大、简单易用、开源免费等优点,在之前工作技术选型的时候,果断的选择了他。 Highcharts API文档 https://api.highcharts.com.cn/highcharts 入门准备 熟悉 Html、jQuery、Json、Ajax 等前端知识 至少会一种后台语言,例如 Php、Java、Asp.net、Nodejs 等(Highcharts只是做数据展现, 具体的数据来源必须通过动态语言 Highcharts入门小示例: 引入在线资源 在页面的head标签里引入在线资源1.8.3.min.js和highcharts.js, 代码如下: < script type = "text/javascript" src = "http://cdn.hcharts.cn/jquery/jquery-1.8.3.min.js" > < / script >   < script type = "text/javascript" src = "http:

canvg and highcharts how to include chart legend and keep the chart size?

佐手、 提交于 2020-01-25 06:29:09
问题 I'm trying to use canvg to draw a highchart inside a canvas. the problem I have is that the chart legends dont appear in the canvas and also the size and quality is reduced. $('#container').highcharts({ credits: { enabled: false }, xAxis: { categories: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'] }, series: [{ data: [29.9, 71.5, 106.4, 129.2, 144.0, 176.0, 135.6, 148.5, 216.4, 194.1, 95.6, 54.4] }] }); function exportChart() { var svg = canvg(document

Highcharts : Export multiple charts to pdf in custom layout

馋奶兔 提交于 2020-01-25 02:56:09
问题 I was trying to export multiple charts to a single pdf with the following layout. It is working well as said in http://jsfiddle.net/BlackLabel/b0jnqd0c/ But when I try to export more number of charts, the entire charts are not exported. For example, if I change the lines in js fiddle code to : $('#export-pdf').click(function() { Highcharts.exportCharts([chart1, chart2, chart3, chart4, chart1, chart2, chart3, chart4], { type: 'application/pdf' }); }); And try to export 8 charts, my export pdf

Highcharts: Ugly Candlesticks

别来无恙 提交于 2020-01-25 00:35:06
问题 My Candlestick chart imports data from a json file. Everything is great when I don't mess with the file But when I use php to exclude some json rows to filter the data, I will end up with this even when every value on chart is correct. How can I fix it? My settings (function () { // $.getJSON('https://www.highcharts.com/samples/data/jsonp.php?a=e&filename=aapl-ohlc.json&callback=?', function (data) { $.getJSON(<?php echo "'getJSON.php?symbol=" . $_GET["symbol"] . "&timeframe=" . $_GET[

Is there any way to automatically calculate the axis labels' step size in Highcharts ?

╄→尐↘猪︶ㄣ 提交于 2020-01-24 22:11:47
问题 I have 1000~ data labels on the xAxis and finding a way to automatically calculate the step based on the number of data labels and size of the charts. Based on the documentation , if I do not set the step property of xAxis.labels , it will be calculated automatically, But in my case it is not. Current output: Expected output: Currenlty the labels look as shown in the image. I'd expect the labels to drop automatically and do not show the ellipses. Any help would be much appreciated. Thanks. -I

Is there any way to automatically calculate the axis labels' step size in Highcharts ?

风格不统一 提交于 2020-01-24 22:11:25
问题 I have 1000~ data labels on the xAxis and finding a way to automatically calculate the step based on the number of data labels and size of the charts. Based on the documentation , if I do not set the step property of xAxis.labels , it will be calculated automatically, But in my case it is not. Current output: Expected output: Currenlty the labels look as shown in the image. I'd expect the labels to drop automatically and do not show the ellipses. Any help would be much appreciated. Thanks. -I

How to add export functionality to custom button in React highcharts?

亡梦爱人 提交于 2020-01-24 16:37:11
问题 I have this project in which I am trying to implement export highchart functionality from out side of the chart. Is there any way I can achieve that? I am using React highcharts and the download formats are Jpeg and CSV. Thanks in advance 回答1: I found an solution using functional components: First import the modules: import * as Highcharts from 'highcharts'; import HighchartsReact from 'highcharts-react-official'; require('highcharts/modules/exporting')(Highcharts); require('highcharts

Custom tooltips in Highcharts diagrams

亡梦爱人 提交于 2020-01-24 11:54:11
问题 Is there any way to make completely custom tooltips in Highcharts diagrams? Not just with different data, or with coloured border, but to make it look different (for example, like a bubble with picture in it). 回答1: Try this: .... tooltip: { useHTML: true, formatter: function() { return 'here the html code'; } }, 回答2: Using the options/api you can only configure such things as border properties and colors (see tooltip options). So without editing the source or going outside the api, no it is

Custom tooltips in Highcharts diagrams

为君一笑 提交于 2020-01-24 11:54:05
问题 Is there any way to make completely custom tooltips in Highcharts diagrams? Not just with different data, or with coloured border, but to make it look different (for example, like a bubble with picture in it). 回答1: Try this: .... tooltip: { useHTML: true, formatter: function() { return 'here the html code'; } }, 回答2: Using the options/api you can only configure such things as border properties and colors (see tooltip options). So without editing the source or going outside the api, no it is