I'm fan of highchart!
Highchart is now support solidGauge chart after 1.7 ver.
So, I try to like below code. But I've some problem. JS version has supports color stops pretty easily.
on GWT version, How can I put this on?
chart.setSolidGaugePlotOptions(new SolidGaugePlotOptions())
.setPane(new Pane()
.setCenter("50%","80%")
.setSize("140%")
.setStartAngle(-90)
.setEndAngle(90)
.setBackground(new PaneBackground().setBackgroundColor("#EEE")
.setInnerRadius("60%")
.setOuterRadius("100%")
.setShape(Shape.ARC))
)
.setCredits(new Credits().setEnabled(false))
.setColors("#DF5353") <---- color How to set gradient color ? How to set stops?
.setAnimation(true)
.getYAxis(0)
.setShowFirstLabel(false)
.setShowLastLabel(false)
.setAxisTitle(new AxisTitle().setText("kW").setY(20))
.setMin(0)
.setMax(max)
.setLineWidth(0)
.setMinorTickInterval(null)
.setTickPixelInterval(400)
.setTickWidth(0);
Series series = chart.createSeries()
.setToolTip(new ToolTip().setValueSuffix(" Watt") )
.setPoints( getDataNumbers(max,0) );
Now just colors #DF5353 display as string type not color class. So How to use gradient color?
Please help me!!
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
If you're asking about the color stops of the gradient that renders from start to finish of the gauge, I believe those colors need to be set on the Y axis (they may work on the plot options as well though, I haven't experimented much with them). Here is a full gauge example that I pulled from another project which utilizes the "setOption()" method to set the "stops" on the Y axis:
I'm fan of highchart!
Highchart is now support solidGauge chart after 1.7 ver.
So, I try to like below code. But I've some problem. JS version has supports color stops pretty easily.
on GWT version, How can I put this on?
Now just colors #DF5353 display as string type not color class. So How to use gradient color?
Please help me!!
There is a setColor method which takes an instance of the Color class that you can use to create gradients.
Last edit: Hong cheong pyo 2015-12-11
If you're asking about the color stops of the gradient that renders from start to finish of the gauge, I believe those colors need to be set on the Y axis (they may work on the plot options as well though, I haven't experimented much with them). Here is a full gauge example that I pulled from another project which utilizes the "setOption()" method to set the "stops" on the Y axis:
Hope that helps!
Thanks a lot!
hi I am trying the above example
As soon as I add the series section i start getting attachDetachException...Here is the exception
com.google.gwt.user.client.ui.AttachDetachException: Exception caught: Exception caught: Exception caught: Exception caught: (String) @org.moxieapps.gwt.highcharts.client.BaseChart::nativeRenderChart(Ljava/lang/String;Lcom/google/gwt/core/client/JavaScriptObject;ZZLcom/google/gwt/core/client/JavaScriptObject;Lcom/google/gwt/core/client/JavaScriptObject;Lcom/google/gwt/core/client/JavaScriptObject;Lcom/google/gwt/core/client/JavaScriptObject;Lcom/google/gwt/core/client/JavaScriptObject;Lcom/google/gwt/core/client/JavaScriptObject;Lcom/google/gwt/core/client/JavaScriptObject;Lcom/google/gwt/core/client/JavaScriptObject;Lcom/google/gwt/core/client/JavaScriptObject;Lcom/google/gwt/core/client/JavaScriptObject;)([string: 'Chart', JavaScript object(69), bool: false, bool: false, JavaScript object(116), JavaScript object(117), JavaScript object(118), JavaScript object(109), JavaScript object(112), JavaScript object(108), JavaScript object(110), JavaScript object(111), JavaScript object(114), JavaScript object(115)]): Highcharts error #17: www.highcharts.com/errors/17
Was wondering if someone could shed a light on why this happens. let me know if more information is needed.
Answering my own question. Apparently I had to include the solid-gauge.js file into my base html file.