Set HTML5 chart type with parameter

I have an HTML5 chart in my report and I want to set the default type from a parameter, but still allow the gear-dropdown to change the type afterwards.

I am using Visualize.js to embed my report into another application.

My jrxml defines the chart in this way:

<hc:chart type="Pie" xmlns:hc="" xsi:schemalocation="">
  <hc:chartsetting name="default">
    <hc:chartproperty name="chart.type">

Where chartTypeParam is the parameter passed into the report.

This works fine to set the default type of the chart. But when I then use the gear menu dropdown in the rendered report to change the type, it just reloads with the same value that was passed in as a parameter.

I want the parameter to define only the default, and still allow the user to select a new type afterwards.

I can get around this problem by making a copy of the chart element for every type I want, then hiding all but one chart as specified by the parameter, but that is horrific and unmaintainable. I would have to have the same configuration code 6 different times.

Any advice would be helpful.

egeorge's picture
Joined: Jun 5 2012 - 2:36pm
Last seen: 4 years 6 months ago

0 Answers:

No answers yet