dynamia-projects / chartjs-zk

ChartJS for ZK (java web framework)
http://www.dynamia.tools
Other
9 stars 3 forks source link

illegal character U+0040 (SyntaxError) #13

Open Ildar1313 opened 2 years ago

Ildar1313 commented 2 years ago

Hello. The chart is not updated.

public ChartjsData getChartData() { CategoryChartjsData chartData = new CategoryChartjsData(); chartData.add("In", new Random().nextInt(10000)); chartData.add("Out", new Random().nextInt(10000)); return chartData; }

ZUL: <chartjs type="pie" data="@load(vm.chartData)"/>

When I click on the button, the chart should be updated: @Command @NotifyChange({"chartData"}) public void updateChart(){ }

But an error occurs: "(illegal character U+0040 (SyntaxError))"

Request:

dtid "z_lq8"
cmd_0 "onChange"
uuid_0 "eT7Q05"
data_0 "{\"value\":\"Operator2\",\"start\":0}"
cmd_1 "onSelect"
uuid_1 "eT7Q05"
data_1 "{\"items\":[\"eT7Q7s\"],\"reference\":\"eT7Q7s\",\"prevSeld\":\"eT7Q6s\"}"

Response:

{"rs":[["setAttr",[{$u:'eT7Qh5'},"data",{"labels":[],"datasets":[{"label":"Values","colorPalette":tools.dynamia.zk.addons.chartjs.ChartjsColorPalette@1eb307c2,"data":null}]}]]],"rid":1}

Ildar1313 commented 2 years ago

Are you planning to fix this bug? I found a workaround: I delete the entire chart and recreate it with updated data.