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
- Rails and highcharts (data to highcharts)
- Non-zero fill centerpoint for highcharts/highstock?
- r - automatically add y axis in highchart
- Highcharts: arrow being rendered on the wrong charts
- How to have a foreach inside a foreach in JQuery?
- Setting formatter callback using highcharts-convert.js
- Change Highchart Options dynamically in angular
- highstock. Can I add one line of tooltip when the point is in the area of plotbands?
- In highcharts how can I provide data with values x, y, title so that I can put the title in the tooltip?
- Highcharts :: Codeigniter
- How to display total of extra data in stacked column high charts
- Angular Highcharts Custom Legend Label In Area Chart
- How do I remove the color swatch from my HighCharts legend without affecting the column?
- High charts gauge-solid and different data sets
- Highcharts scatter plot with lots of data points running really slow
- Highcharts - hover event handling for tooltip throws exception
- Get Value Json Data to series name Highchart
- Print session variable (array) in x axis of Highcharts
- Highcharts multiple yAxis, the second yAxis labels are not showing but the title is
- Highstocks: Move Renderer elements along with navigator/ Draw Trendlines
- Highcharts 'area' type with normal stacking looks weird
- Hightcharts: Set series label in last point
- Highcharts using AngularJS, NodeJS and Mongoose
- Convert JQuery Data into HighChart Format
- Sankey: Show dynamically text on x-axis
- Formatting Highchart dateime time categories
- Highcharts: How to make curve start outside of the visible view horizontally?
- Dynamically add a Highchart point while preserve categories
- Highcharts xAxis with datetime not showing any chart
- Is it possible with Chart js or which chart Library can provide this type of chart?