miloschuman / yii2-highcharts

Highcharts widget for Yii 2 Framework
http://www.yiiframework.com/extension/yii2-highcharts-widget/
MIT License
166 stars 63 forks source link

high chart is not visible #50

Closed ajkosh closed 7 years ago

ajkosh commented 7 years ago

when i m using any chart it is showing black color box,no chart. erorrr

miloschuman commented 7 years ago

@ajkosh, I am unable to reproduce. Do you have a public facing page or fiddle to test?

dantux commented 7 years ago

I have a similar issue. Regardless what options I choose for the chart (I tried copying the example chart in your github readme) and it doesn't show anything. Firefox in the web developer toolbar shows these errors:

Use of Mutation Events is deprecated. Use MutationObserver instead. ContentVeil.js:2:4726 TypeError: can't assign to properties of (new String("{ \"color\": \"#333333\", \"fontSize\": \"18px\" }")): not an object

Any ideas?

miloschuman commented 7 years ago

@dantux, that first error appears to be from a script included via an Evernote browser extension and is unrelated. The second error should lead you to the likely culprit in your code. Search your highcharts widget code for a string like { "color": "#333333", "fontSize": "18px" }. If you need to pass any JavaScript/JSON options, they must be wrapped in a new JsExpression() object or else they'll be interpreted as a string. For instance, instead of

'someOption' => "{ \"color\": \"#333333\", \"fontSize\": \"18px\" }",

... use

'someOption' => new JSExpression("{ \"color\": \"#333333\", \"fontSize\": \"18px\" }"),