Highcharts

Highcharts x-axis tick starts with an offset

微笑、不失礼 提交于 2019-12-17 19:55:20
问题 I am trying to remove the offset on the tick of the x-axis . I want the first tick 10/8 to start from the x-axis and y-axis intersection. 10-8 should be on the marker which is between the two labels. I have following code for it in highchart. xAxis: { categories: categories, title: { text: title_x_axis, style: { fontWeight: 'bold' }, formatter: function(){ return "<h3><b>" + this.value + "</b></h3>"; } }, min: 0, startOnTick: true, endOnTick: true, minPadding: 0, maxPadding: 0, align: "left"

To pass dynamic json array to Highcharts Pie Chart

好久不见. 提交于 2019-12-17 19:29:53
问题 I passed json encoded string(eg. $TEXT2 consisting ["chrome","15","firefox","20"]) from xcode to an array(eg. arr) in javascript.Now I want to pass this array containing json string dynamically to Highcharts Pie. The HTML code is <!DOCTYPE HTML> <html> <head> <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=20, user-scalable=no;" /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>Pie chart</title> <!-- 1. Add these JavaScript

Highchart series update in javascript

让人想犯罪 __ 提交于 2019-12-17 19:15:23
问题 I'm trying to update a Highchart series by generating a new array with the current data from the database. But for some reason I can only find info about going through the data one at a time. Once a chart is created, its only re-running the same code again so the labels etc don't change - only the [pointStart] and the [data] change. Is there a way to update all the data as a whole? I also haven't managed to get a for loop to work correctly. function generateSeries(data){ var cData = []; var

How to set Highcharts chart maximum yAxis value

混江龙づ霸主 提交于 2019-12-17 18:18:09
问题 I've been trying for two days to find a way to set the maximum value of the yAxis on Highcharts. I got a percentage column graphic , but the highest value in the series is 60, so it adjusts the axis to top at 70 , I found a way to choose the start point , but no way to choose the end point . What I really need is to set the yAxis from 0 to 100 , so the data will be more accurately viewed as percentage Thanks in advance, Bruno W.G. 回答1: Try this: yAxis: {min: 0, max: 100} See this jsfiddle

highcharts pass multiple values to tooltip

两盒软妹~` 提交于 2019-12-17 18:17:48
问题 I need to display 3 values on the tooltip: the time, the value and another value(change). I saw this example (but the jsdfiddle is not working). I tried this //each loop.. indice.push(["time", "value1", "value2"]); , the tooltip settings tooltip: { useHTML: true, formatter: function() { return '' + Highcharts.dateFormat('%H:%M:%S', this.x) +'; '+ this.y + this.z(<-is this right?); } }, and the series series: [{ type: 'area', data: indice }] can somone help pls? thsnks. 回答1: If you want to

Highcharts: Export multiple charts using jspdf

耗尽温柔 提交于 2019-12-17 16:54:27
问题 When I try to export several Highcharts charts using jsPdf I'm not getting the graph in the proper way. Could you please help me out in this? JAVASCRIPT CODE Highcharts.chart('container', { title: { text: 'Solar Employment Growth by Sector, 2010-2016' }, subtitle: { text: 'Source: thesolarfoundation.com' }, yAxis: { title: { text: 'Number of Employees' } }, legend: { layout: 'vertical', align: 'right', verticalAlign: 'middle' }, plotOptions: { series: { label: { connectorAllowed: false },

How to make highcharts scrollable horizontally when having big range in x-axis

与世无争的帅哥 提交于 2019-12-17 16:11:35
问题 I am generating my x-axis and y-axis data dynamically and displaying highcharts, but the chart becomes messy when the x-axis range is high with small intervals. How do I make highcharts to make normal horizontally scrollable graph? Here is what I am using right now: <div id="container" style="min-width: 400px; height: 400px; margin: 0 auto"></div> //CODE FOR HIGHCHARTS JS function makeChart() { $('#container').highcharts({ chart: { type: 'line', marginRight: 130, marginBottom: 100 }, title: {

Highcharts - Show tooltip on points click instead mouseover

让人想犯罪 __ 提交于 2019-12-17 12:37:48
问题 Is it possible to have tool tip on clicking of points instead of mouse move. I have tried with showing values in java script alert as below plotOptions: { series: { cursor: 'pointer', point: { events: { click: function() { alert ('Category: '+ this.category +', value: '+ this.y); } } } } } Requirement is to show high chart tool tip on click. Please help. Thanks! 回答1: As @PawelFus states, it's not officially supported but you can fudge this in by taking control of the visiblity of the tooltip.

How to disable legend click to stop pie slice from disappearing in Highcharts?

我们两清 提交于 2019-12-17 11:27:12
问题 How to disable legend click to stop pie slice from disappearing in Highcharts?? See example here: http://www.highcharts.com/demo/pie-legend Can anyone help?? 回答1: You do this by attaching a handler to the legendItemClick event and just returning false . This will prevent the default action which is to toggle the pie sector. point: { events: { legendItemClick: function () { return false; // <== returning false will cancel the default action } } } See this example http://jsfiddle.net/mfras3r

Highstock highcharts irregular data gets wrong x-scale

有些话、适合烂在心里 提交于 2019-12-17 10:47:22
问题 I have irregular data. Chart draws well when I use highcharts : $(function() { var chart = new Highcharts.Chart({ chart: { renderTo: 'chart' }, xAxis: { type: 'datetime' }, series: [{ name: 'Volume', data: chart_arr, }] }); }); http://jsfiddle.net/KnTaw/9/ But I have a lot of data so I need to zoom on the date and choose highstock . Then a strange thing happens: the x-axis become non-linear. $(function() { var chart2 = new Highcharts.StockChart({ chart: { renderTo: 'chart2' }, rangeSelector: