When the DateTime label is changed on an axis it isn't updated on the chart.
publicvoidonModuleLoad(){RootPanel.get().add(createChart());}publicCanvascreateChart(){finalChartchart=newChart().setType(Series.Type.LINE).setChartTitleText("Facility productivity").setBackgroundColor("#FFFFFF").setShadow(true).setZoomType(ZoomType.X).setCredits(newCredits().setEnabled(false));chart.getXAxis();chart.getYAxis();chart.getXAxis().setType(Type.DATE_TIME);chart.setSizeToMatchContainer();chart.setReflow(true);finalCanvascw=newCanvas();cw.addChild(chart);cw.setSize("500px","500px");chart.setSize("500px","500px");IButtonbutton=newIButton("click");button.addClickHandler(newClickHandler(){@OverridepublicvoidonClick(ClickEventevent){DateTimeLabelFormatsdateTimeLabelFormat=newDateTimeLabelFormats();setFormat(dateTimeLabelFormat,"%l%p %b %d");chart.getXAxis().setDateTimeLabelFormats(dateTimeLabelFormat);LinePlotOptionsoptions=newLinePlotOptions();options.setPointInterval(3600*1000);chart.removeAllSeries();chart.addSeries(chart.createSeries().setName("Hestavollane").setPoints(newNumber[]{4.3,5.1,4.3,5.2,5.4,4.7,3.5,4.1,5.6,7.4,6.9,7.1,7.9,7.9,7.5,6.7,7.7,7.7,7.4,7.0,7.1,5.8,5.9,7.4}).setPlotOptions(options));}});RootPanel.get().add(button);returncw;}/***Forces format onto the axis.*/privatevoidsetFormat(DateTimeLabelFormatslabelFormat,Stringformat){labelFormat.setHour(format);labelFormat.setMinute(format);labelFormat.setDay(format);labelFormat.setWeek(format);labelFormat.setMonth(format);labelFormat.setYear(format);}
When you click the button , the date time label is supposed to change to 3AM , 4AM etc. But it doesn't.Any suggestions ?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
When the DateTime label is changed on an axis it isn't updated on the chart.
When you click the button , the date time label is supposed to change to 3AM , 4AM etc. But it doesn't.Any suggestions ?