CGDevTools Forum

Welcome to the Official CGDevTools Support Community Forums.

IWCGJQPlot, Donut Font Color

by dfields » 22 Jan 2015 20:51

Which property controls the font color for the segments of a donut chart? The code below renders the chart I want, and I have been able to set the desired colors using JQPlotOptions.SeriesColors. I would like to set the font color to white for all segments.

Code: Select all
IWCGJQPlot1.JQPlotData := '[[[''a'',6], [''b'',8], [''c'',14], [''d'',20]]]';
IWCGJQPlot1.JQPlotOptions.SeriesDefaults.Renderer:= jqprDonutRenderer;
IWCGJQPlot1.JQPlotOptions.SeriesDefaults.DonutRendererOptions.SliceMargin:= 3;
IWCGJQPlot1.JQPlotOptions.SeriesDefaults.DonutRendererOptions.StartAngle:= -90;
IWCGJQPlot1.JQPlotOptions.SeriesDefaults.DonutRendererOptions.ShowDataLabels:= True;
IWCGJQPlot1.JQPlotOptions.SeriesDefaults.DonutRendererOptions.DataLabels := '{"value"}';
IWCGJQPlot1.Visible := true;
dfields
 
Posts: 130
Joined: 24 Jul 2013 20:14

by Alexander Bulei » 23 Jan 2015 11:12

Hi Daniel,

Here you have 2 examples to do that:

delphi code
{Via CSS}
IWCGJQPlot1.Css:= 'my-plot1';
IWCGJQPlot1.JQPlotData := '[[[''a'',6], [''b'',8], [''c'',14], [''d'',20]]]';
IWCGJQPlot1.JQPlotOptions.SeriesDefaults.Renderer:= jqprDonutRenderer;
IWCGJQPlot1.JQPlotOptions.SeriesDefaults.DonutRendererOptions.SliceMargin:= 3;
IWCGJQPlot1.JQPlotOptions.SeriesDefaults.DonutRendererOptions.StartAngle:= -90;
IWCGJQPlot1.JQPlotOptions.SeriesDefaults.DonutRendererOptions.ShowDataLabels:= True;
IWCGJQPlot1.JQPlotOptions.SeriesDefaults.DonutRendererOptions.DataLabels := '{"value"}';

ExtraHeader.Add('<style>.my-plot1 .jqplot-data-label { color: #FFF; }</style>');
{OR ADD CSS CLASS TO YOUR CUSTOM CSS FILE}

{Via Plot config}
IWCGJQPlot2.JQPlotData := '[[[''a'',6], [''b'',8], [''c'',14], [''d'',20]]]';
IWCGJQPlot2.JQPlotOptions.SeriesDefaults.Renderer:= jqprDonutRenderer;
IWCGJQPlot2.JQPlotOptions.SeriesDefaults.DonutRendererOptions.SliceMargin:= 3;
IWCGJQPlot2.JQPlotOptions.SeriesDefaults.DonutRendererOptions.StartAngle:= -90;
IWCGJQPlot2.JQPlotOptions.SeriesDefaults.DonutRendererOptions.ShowDataLabels:= True;
IWCGJQPlot2.JQPlotOptions.SeriesDefaults.DonutRendererOptions.DataLabels := '{"value"}';
IWCGJQPlot2.JQPlotOptions.SeriesDefaults.DonutRendererOptions.DataLabelFormatString:= '<span style="color:#FFF">%d%%</span>';


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 General

Who is online

Users browsing this forum: No registered users and 81 guests

Contact Us.