CGDevTools Forum

Welcome to the Official CGDevTools Support Community Forums.

Change IWCGJQSimplePieChart FgColor by sourcecode

Questions & Answers about IWCGJQuery Suite.

by JRehorst » 27 Mar 2015 17:19

Dear Support Team,

how is it possible to set the chart color during runtime. In the options JQChartOptions I can' find the property FgColor during source code programming to set the color.

Thanks Jens
JRehorst
 
Posts: 3
Joined: 27 Mar 2015 16:09

by Alexander Bulei » 27 Mar 2015 17:37

Hi Jens,

First, you need use appropriate type function, depend on ChartType property:

Code: Select all
    function PieChartOptions: TIWCGJQPieChartOptions;
    function CirclifulChartOptions: TIWCGJQCirclifulChartOptions;
    function CirclesChartOptions: TIWCGJQCirclesChartOptions;


For example, if you have ChartType = spctCircliful, you need use CirclifulChartOptions.

Then, in runtime, on any option's changing (except value), you need call AjaxReRender function at end, because in this component
there is no support f or ajax changing...

here you have simple example:

delphi code
IWCGJQSimplePieChart1.ChartType:= spctCircliful;
IWCGJQSimplePieChart1.CirclifulChartOptions.FgColor:= '#000';
IWCGJQSimplePieChart1.CirclifulChartOptions.BgColor:= '#EEE';

// update
IWCGJQSimplePieChart1.AjaxReRender(True,False);


Best Regards.
Group: Developers | Support Team

  • info [at] cgdevtools.com - General information
  • sales [at] cgdevtools.com - Sales department
  • support [at] cgdevtools.com - Product and Technical Support
User avatar
Alexander Bulei
Site Admin
 
Posts: 3635
Joined: 15 May 2012 08:52
Location: Mealhada, Portugal

by JRehorst » 30 Mar 2015 08:40

Hello All,

setting of color is now OK. But when running the program I receive an error "Method RenderRegionAsync its only allowed in Ajax Processing".

Source in IWCGJQFrameCreate:
if rQuote >= 98 then
iwpieOUT.CirclifulChartOptions.FgColor := 'clWebDARKGREEN'
else if rQuote >= 96 then
iwpieOUT.CirclifulChartOptions.FgColor := 'clWebDARKORANGE'
else
iwpieOUT.CirclifulChartOptions.FgColor := 'clWebDARKRED';
iwpieOUT.Value := StrToFloat(FormatFloat('0.00', rQuote));
iwpieOUT.AjaxReRender(True, False);

How to avoid this error?

Thanks
Jens
JRehorst
 
Posts: 3
Joined: 27 Mar 2015 16:09

by Alexander Bulei » 30 Mar 2015 10:14

Hi Jens,

Check this topic: viewtopic.php?f=5&t=22

Then, check your Ajax property in event.

AjaxReRender works in ajax request/mode only.

Best Regards.
Group: Developers | Support Team

  • info [at] cgdevtools.com - General information
  • sales [at] cgdevtools.com - Sales department
  • support [at] cgdevtools.com - Product and Technical Support
User avatar
Alexander Bulei
Site Admin
 
Posts: 3635
Joined: 15 May 2012 08:52
Location: Mealhada, Portugal


Return to Q & A

Who is online

Users browsing this forum: No registered users and 1 guest

Contact Us.