score:2
Accepted answer
With Highcharts? There's not simple way to achieve that.
However, using Highstock, simply use xAxis.ordinal = true
and everything will work. See: http://jsfiddle.net/G5S9L/8/
score:0
For the second question, you can simply extend the Point class(wrap applyOptions method), and set the categories of xAxis.
(function (H) {
H.wrap(H.Point.prototype, 'applyOptions', function (applyOptions, options, x) {
var point = applyOptions.call(this, options, x),
series = point.series;
// check if
// 1. there is a name(category)
// 2. xAxis has the categories defined
// 3. x value equals xIncrement
if (point.name && series.xAxis.categories && point.x === series.xIncrement - 1) {
// find a matching category?
var idx = series.xAxis.categories.indexOf(point.name);
if (idx >= 0) {
point.x = idx;
}
}
return point;
});
})(Highcharts);
See fiddle: http://jsfiddle.net/G5S9L/17/
Source: stackoverflow.com
Related Query
- Highcharts - Column chart with empty columns for date in x-axis
- Creating a drilldown chart with Highcharts that contain double(multiple) columns for each column (see example for better explanation)
- HighCharts - Single legend for two columns in a Stack Column chart
- Highcharts column with drilldown results in blurred data label in main chart, except for the drilled down columns
- Format used for date in Highcharts - Line with markers chart type
- Line and column combo chart with multiple columns for each category, how to position line marker for each category on a specific column?
- Highcharts - Column chart with legend for each data
- Combining categories for column chart with Highcharts
- Highcharts with date and time for x axis (from a database with format YYYYMMDDHHMM)
- Highcharts - best way to handle and display zero (or negative) values in a line chart series with logarithmic Y axis
- Highcharts Column chart with drilldown, remove hyperlink like formatting from x-axis labels
- Highcharts blank chart with x and y axis
- Highcharts Grouped Column Chart with Multiple Groups?
- highcharts - precision for stacked column chart data labels
- Highcharts - Display legend for Pie chart in two columns
- Using Trellis Chart with Stacked Columns in Highcharts
- Fire click event on a highchart column drilldown chart on clicking x axis for drill down reports
- Highcharts column + line combination chart with multiple series. Issue aligning line over the column
- How to format my json data for stack column chart in HighCharts
- Highcharts multiple column chart with drilldown, correct formatting of drilldown axes
- Splitted bar chart for paired data with highcharts
- How to Build a Column Chart in Highcharts with Data Entered Dynamically Within a CMS
- Drilldown for grouped column chart in highcharts
- Highcharts - column chart with drilldown to waterfall
- Legend for each point in column chart in highcharts
- Highcharts stacked columns with Y Axis grouping
- How to use Highcharts React to create chart with multiple lines for same XAxis?
- Nested table yields unexpected columns for a basic column graph using high charts with 'Data defined in a HTML table'
- HighCharts Column Chart Spacing Between Columns
- Stacked column chart with irregular date time interval
More Query from same tag
- Highchart to show progress percentages in horizontal bars with real time data?
- highstock with json data
- How to know information about the clicked bar in highchart column r shiny plot
- Server side chart .svg export with Highcharts and PhantomJS, error loading data from .csv file
- Highcharts : Info about clicked legend item pass to controller
- How to draw the line maximum Height for Highchart(area spline)
- How to add a line at the bottom of a column chart in highcharts
- Yii vs Highcharts vs Ajax
- Highcharts CSS Styling Axis Font
- Replicating a highcharts type
- Highcharts remove column defined by keys from export to CSV
- Can't update highcharts data on button - var visibility or events handle issue
- Error bars (confidence intervals) in Highcharts
- Highcharts bubble chart datalabels not display
- Highchart with background should be Dots instead of Grid
- Highcharts - change seconds to time (H:M:S) in data labels
- How to center the title text in pie chart highchart?
- HiChart click event 1st time it's working but when I update the data then click event is not working
- Highcharts heatmap logarithmic colorAxis fails when 0
- Highchart: endOnTick not finishing with the max extreme set for xaxis
- Highcharts hide legend item from Pie chart
- move x and y axis from left to right in highchart
- Live Graph in HighCharts
- Highcharts: displaying data sets from one series
- Highchart gauge not displaying min/max value in Vue.js
- Highchart in long array group categories
- Highcharts and the export of table data
- Highcharts - label placement for categorized y-axis
- Highcharts: Show x-axis labels ony for years ending in zero (1950, 1960, 1970, ...)
- Easier way to draw a bar chart using highcharts?