score:2
I've figured it out finally!
GWT-HighCharts seems to be the problem. It does not add the new YAxis to the Chart at all. So you must add YAxis via native calls like this;
private static native void nativeAddAxis(JavaScriptObject chart, JavaScriptObject axisOptions, boolean isX, boolean redraw, boolean animationFlag) /*-{
chart.addAxis(axisOptions, isX, redraw, animationFlag);
}-*/;
Just call this native method before adding the new series.
// Create new series
Series newSeries = chart.createSeries().setYAxis(index);
newSeries.setPlotOptions(new LinePlotOptions().setColor(tag.getColor()));
newSeries.setName(index + 1 + ") ");
// Create a new YAxis
YAxis yAxis = chart.getYAxis(index).setPlotLines(chart.getYAxis(index).createPlotLine().setValue(0).setWidth(1).setColor(tag.getColor())).setLabels(new YAxisLabels().setEnabled(false)).setTickLength(0).setOffset(60)
.setStartOnTick(false).setEndOnTick(false).setGridLineWidth(0).setPlotLines().setMaxPadding(DEFAULT_YAXIS_MAX_PADDING).setMinPadding(DEFAULT_YAXIS_MIN_PADDING)
.setAxisTitle(new AxisTitle().setText(null).setStyle(new Style().setColor(tag.getColor())));
// IMPORTANT!: New YAxis must be added to the chart via native calls since gwt-highcharts wrapper doesn't do that properly!
nativeAddAxis(chart.getNativeChart(), yAxis.getOptions().getJavaScriptObject(), false, false, false);
// Physical attach
chart.addSeries(newSeries);
score:1
please check the index value. if index is more than the axis count this error may occur
highcharts error #18 indicates that the axis trying to access does not exist.
here is the link http://www.highcharts.com/errors/18
Hope that will help you
score:2
Here is the cause of this type of errors:
If you are using GWT-HighCharts wrapper, you must make the configuration before adding chart to DOM! It seems that after adding it to the DOM, any configuration changes does not seem to work at all!
Happy coding!
Source: stackoverflow.com
Related Query
- HighCharts Stock Chart error code 18
- highcharts organization chart is throwing error when loading module
- Show value of last point as label or tooltip on Highcharts Stock Chart
- creating a bar chart using Highcharts with React - getting an error that rendering div isn't found
- Issues using highcharts node export server from ClojureScript - "0x03 error when performing chart generation"
- Highcharts stock chart - Technical Indicators - Stock price is missing in the tooltip when selecting the 'All' range
- Java Script Type Error while adding Stock Chart to GWT SimplePanel
- Highcharts - bubble chart with titles at x- and y-Axis - Error #14
- Drawing Bubble Chart by using npm highcharts with error #17
- HighCharts Stock Chart fire event on chart redraw?
- Returning JSON file with cURL to use data in a HighCharts stock chart
- Highcharts stock chart based on data from Quandl API
- Highcharts display label for pie chart using html table as data source
- save chart button of stock tool chart not working in highcharts
- HighCharts error #17 for pyramid chart angular2
- angular 2 Highcharts Stock Chart differences
- HighCharts: strange error from creation of stock chart
- Highcharts stock chart not showing up with custom data
- Highcharts stock chart overflow above of yAxis lable
- Uncaught Error: Highcharts error #17 while creating sunburst chart using react
- Highcharts stacked data, stock like chart
- Highcharts pie chart slice animation only works when an error is thrown
- Error in rendering a React highcharts x-range chart
- Setting min and max for chart in Highcharts library error
- Error: Data source must be a URL for refresh | console error | javascript | Highcharts
- Highcharts cloud issue with data source when duplicating chart
- Highcharts chart with error bars using react-highcharts
- Highcharts - Json display an error message in place of the chart
- error with adjusting height of pie chart using highcharts
- Highcharts stock chart time selector
More Query from same tag
- highcharts different tick interval
- Dock highcharts legend to very bottom of chart
- Chartkick Datepicker/Range Selector - Possibility to choose dates to show data
- Blank boxes in high chart when data is null
- Parsing CSV and then Using the Data to Build Highcharts Bar Chart
- Is it possible to change the name of "x" for x data?
- Bar chart data label and bar custom css with bar background,Highchart
- Highcharts: Remove space between plot border and actual chart
- Highcharts, pass Data from json on Column Click
- How to draw a vertical line from a xAxis click event in Highcharts?
- Calculating percentage value for each serie in highcharts
- Highcharts Server side generation not working on windows 2008 server
- Highcharts Ganttchart (or XRange) group y-Axis elements
- How to hide data in a series in highcharts boxplot?
- Convert Culture.DateTimeFormat to HighChart's xDateFormat string
- How to add multple plotlines for yaxis using highcharts?
- Change Highmaps map colour
- Use MySQL data as the chart data for the cakephp highchart plugin
- How to click in a serie area chart below another serie area chart in HighCharts?
- Set at the same level the unit of two yaxis highcharts
- Implementing highcharts for Coin currency market
- JavaScript for loop returns last item in array only
- Complicated multidimensional array to use in highchart series
- Highcharts Y Axis Tick Marks not setting
- Customizing date in tooltip when datgrouping enabled
- Finding width of secondary yaxis
- How to update/add Highchart options/properties after the chart/object has been created?
- Adding gap between specific bars in a stacked bar chart
- How can I display the current value from a chart?
- Highcharts - trying to start x-axis tickmark at a half hour point