score:2
Accepted answer
grouped categories plugin expects format of categories that is not supported directly by highcharts. data module is highcharts official plugin, so it will not work like that by default or by using some available settings. parsing csv data - creating series data array and categories object could be the way to resolve the problem.
here is example of what that parser might look like: http://jsfiddle.net/vboak5hr/
$.get('data.csv', function(data) {
// split the lines
var lines = data.split('\n');
var series = [];
// iterate over the lines and add categories or series
$.each(lines, function(lineno, line) {
var items = line.split(';'),
hasthiscategory = false,
categoryindex = -1,
categorypath = options.xaxis.categories;
//add data point to series data
options.series[0].data.push(parseint(items[3]));
// i. level of categories
highcharts.each(categorypath, function(category, i) {
if (category.name === items[0]) {
hasthiscategory = true;
categoryindex = i;
}
});
if (!hasthiscategory) {
categorypath.push({
name: items[0],
categories: []
});
}
if (categoryindex === -1) categoryindex = categorypath.length - 1;
// ii. level of categories
categorypath = categorypath[categoryindex].categories;
hasthiscategory = false;
categoryindex = -1;
highcharts.each(categorypath, function(category, i) {
if (category.name === items[1]) {
hasthiscategory = true;
categoryindex = i;
}
});
if (!hasthiscategory) {
categorypath.push({
name: items[1],
categories: []
});
}
if (categoryindex === -1) categoryindex = categorypath.length - 1;
// iii. level of categories
categorypath = categorypath[categoryindex].categories;
hasthiscategory = false;
categoryindex = -1;
highcharts.each(categorypath, function(category, i) {
if (category === items[2]) {
hasthiscategory = true;
}
});
if (!hasthiscategory) {
categorypath.push(items[2]);
}
});
// create the chart
var chart = new highcharts.chart(options);
});
Source: stackoverflow.com
Related Query
- Highcharts grouped categories data csv
- Highcharts series visibility with csv data source
- Highcharts - Force Categories in x-axis to be shown, even without data
- Creating a line graph with highcharts and data in an external csv
- Exporting highcharts data to CSV file
- Highcharts - Global configuration with common code and unique data & Headings
- load data in highcharts from 2 different csv files
- Highcharts Grouped Data In Subgroup
- Load CSV data via Ajax for display in Highcharts
- highcharts refresh CSV data is duplicating not refreshing
- How to Load More Than One CSV Using Highcharts Data Module
- Highcharts categories from data array
- How to process csv data (datetime) month, week, day, hour in highstock highcharts
- remove space on same parent categories | Grouped Categories Highcharts
- Show Data For Grouped Series in ToolTip Highcharts
- Parse CSV for multiple categories in Highcharts
- Highcharts display label for pie chart using html table as data source
- Add Source to Highcharts Export CSV
- Include additional highcharts source data in angular2 app
- Highcharts csv data loading
- Passing string data as categories to Highcharts
- Highcharts not displaying data but drawing chart when reading from CSV file
- Not able to load local csv data into Highcharts
- HTML table as data source for highstock charts using highcharts
- HighCharts xAxis categories over 1000 data not work.
- getting csv data into highcharts
- How to change line color when loading static csv data into Highcharts Highstock graph?
- Scrape Highcharts data to CSV file
- How to have multiple highcharts with different series data in vuejs without repeating code
- Highcharts Update Grouped Series Data Point Colors
More Query from same tag
- Obtaining highcharts image URL from PHP
- Highcharts step & offset x axis labels?
- Add a dropdown to Highcharts to change chart type with AngularJs
- bar charts with grouped column
- How to handle mouse events on axis labels in highcharts
- Highcharts with multiple series from JSON
- How can I make HighCharts 4.2.5 with boost.js invoke the tooltip formatter?
- Highcharts 3.0, area chart with stacked and unstacked series - how to fix?
- How to export the whole page or html content with Highcharts not just the chart?
- Update highcharts data dynamically on HTML form value change
- Gradient fill for guage - Highcharts
- How to plot horizontal lines over the some columns of columnrange chart in Highcharts
- How to make two charts using highchart show up in the same line side by side using div
- Add values to rCharts hPlot tooltip
- Highcharts tooltip x axis font size
- Set chart options when printing and add a footer
- Scrape data from graph generated with Highcharts
- How to export CSV and XLS with external button in Highcharts
- Highcharts. Marks on grid lines
- HighChart - Custom Paths Not Linked to Chart
- mouseOver in Highcharts
- When i use highcharts then my DataTable lost his functionality.
- Problems with retrieving mysql data into javascript in a specific format
- Highcharts getSVG() - Keep HTML formatting in legend
- Exporting chart with Highchart display a badly formed chart
- Move the Highstock navigator position
- Highcharts Multiple Bar Colours in X-Range
- Minor change cause HighStock charts syncing to fail
- highChart pdf download
- Setting custom colors in Highcharts drill-down maps