score:1
Accepted answer
the stack option doesn't refer to the category index as you expect in your example.
you use stack: 'a' and stack: b' and have one y value for each series. it means that two stacked columns are grouped for one category.
take a look at the api reference and its demo: https://api.highcharts.com/highcharts/series.column.stack
to achieve a stacked column for each category you need to parse mes to the number (timestamp) and pass it as an x
value.
var series = [];
for (var i = 0; i < data.length; i++) {
mes = new date(data[i][0]).gettime() + 60 * 60 * 1000,
total = data[i][1];
categoria = data[i][2];
series.push({
name: categoria,
data: [{x: mes, y: total}],
datalabels: {
enabled: true,
}
});
}
then set your xaxis.type
to datetime
and change label format.
xaxis: {
type: 'datetime',
labels: {
format: '{value:%y-%m}'
},
},
example demo: https://jsfiddle.net/blacklabel/vuldezxw/
Source: stackoverflow.com
Related Query
- Loop in xAxis from highcharts according to returned data
- HighCharts - data from different intervals in one xAxis (hide second xAxis)
- Pass array from js for loop to highcharts series data
- Passing Returned Data from a PHP Script into a Highcharts data[] block?
- How to include data from point in Highcharts xAxis label?
- Highcharts displays series names but missing data points from json source
- Proper way to remove all series data from a highcharts chart?
- Python: Read data from Highcharts after setExtreme
- Scraping data from Highcharts using selenium
- Send JSON data to highcharts pie from asp.net MVC controller in C#
- Converting svg from Highcharts data into data points
- Add dynamic data to line chart from mysql database with highcharts
- How to set second yAxis scale according to data from first yAxis
- How can i change highcharts data values by selecting from a dropdown list
- Using PhantomJS to create HighCharts grahps server side for use in PDF creation (PHP) - results in exit code 11 from PHPs exec();
- Highcharts - Global configuration with common code and unique data & Headings
- HighCharts Time-based Quarterly Data - xAxis Label Issue
- How to populate a Highcharts axis with string formatted data from a PHP array
- Format Highcharts xAxis for stock data
- load data in highcharts from 2 different csv files
- Highcharts bargraph from json data in angularJS
- Passing data from db into Highcharts in Rails 3.x
- Highcharts - set yAxis.max to max value from data
- Loading data from API into a highcharts vue component
- passing data from database to highcharts in Django
- Highcharts xAxis shows labels from drilldown on drillup
- Formatting JSON from a Pandas data frame for Highcharts within a Django template
- Highcharts get data from database
- How to make Highcharts fetch data from external JSON file?
- Passing data to highcharts from javascript array or variable
More Query from same tag
- How to round of bar values in highcharts
- Highcharts does not display years on Xaxis when data with NULL values
- Firefox && IE TypeError: Argument 1 of Window.getComputedStyle does not implement interface Element
- How to de-couple and do dependency injection with highcharts-ng
- How to show a legend for a bar chart in Ruby on Rails?
- Highcharts Gauge chart is rounding down max number
- Remove Export and print button plugin on highchart chart
- Highchart line renders bigger when exported to pdf using css2pdf
- One hyper link below each legend of pi-chart
- Highcharts Line Chart - Hyperlink on a data point
- How can I change the distance between columns in highcharts?
- Angular - highcharts-angular / bootstrap / chart not growing to parent size width
- Highcharts - hide dataLabels leaders
- How to use react-highcharts to plot bell curve
- How to add a border to the title in highcharts
- Gap Occurring between tooltip and the graph in Combined Column and Scatter Graph
- highcharts tooltip not moving next point
- How to hide a highcharts pie slice programatically
- make xaxis datalabels have same color like bar Highcharts
- Highcharts won't slant data on a bar chart
- Moving of series in Highcharts
- Disable stretching time axis by additional tick (highcharts)
- Is there any way we can use Highcharts with mPDF converter?
- Highcharts - applying background image to container div
- Automatic fold/unfold Y-axis break on mouse over
- Changing charts tooltip
- Resize a chart before printing with Highcharts
- highcharts non numeric range on secondary yAxis
- How do I get DateTime from mysql and set it to json format ready for highcharts
- How to change the background series colour of Highcharts Radar chart