CGDevTools Forum

Welcome to the Official CGDevTools Support Community Forums.

JQPlot-BarGraph, with 3 Values. How many series?

by dfields » 19 Sep 2014 20:46

I need to use a JQPlot to present 3 values in a bar graph. I would like each bar to have its own color, and show a text label on the x-axis. SO far I can only get the basic graph showing. I cannot figure out how to get the x-axis labels. Should I be using a single series?

I am working backwards from the examples in the demo.

Code: Select all
IWCGJQPlot1.JQPlotData:= '[[200],[600],[700]]';
IWCGJQPlot1.JQPlotOptions.SeriesDefaults.Renderer:= jqprBarRenderer;
IWCGJQPlot1.JQPlotOptions.SeriesDefaults.BarRendererOptions.FillToZero:= True;
IWCGJQPlot1.JQPlotOptions.SeriesDefaults.PointLabels.Show:= True;
IWCGJQPlot1.JQPlotOptions.Legend.Show:= false;

Axis:= IWCGJQPlot1.JQPlotOptions.Axes.Add;
Axis.Options.AxesRender:= jqparCategoryAxisRenderer;

Axis:= IWCGJQPlot1.JQPlotOptions.Axes.Add;
Axis.AxisType:= jqpoxyYAxis;
Axis.Options.Pad:= 1.05;
Axis.Options.TickAxisOptions.FormatString:= '%d';
dfields
 
Posts: 130
Joined: 24 Jul 2013 20:14

by Jorge Sousa » 19 Sep 2014 22:48

Hello

The jqplot expert only will be here on Monday.

Can you find an example of what you want in our demo or in here?
Best Regards
CGDevTools Develop / Support Team
Home Page: http://www.cgdevtools.com
Jorge Sousa
 
Posts: 4261
Joined: 17 May 2012 09:58

by Alexander Bulei » 22 Sep 2014 11:53

Hi dfields,

Do you need something like this?

22-09-2014 11-49-52.png


Best Regards.
You do not have the required permissions to view the files attached to this post.
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 dfields » 22 Sep 2014 18:54

Yes. I was also trying to have each bar be a different color. I have been able to accomplish that by using 3 series, each with a single value.

How do you add the x-axis value labels?
dfields
 
Posts: 130
Joined: 24 Jul 2013 20:14

by Alexander Bulei » 23 Sep 2014 09:21

Hi dfields,

Here you have the code:

delphi code
procedure TIWForm3.IWAppFormCreate(Sender: TObject);
var
Axis: TIWCGJQPlotOptionsAxesItem;
begin
IWCGJQPlot1.JQPlotData:= '[[["Test1",200],["Test2",600],["Test3",700]]]';
IWCGJQPlot1.JQPlotOptions.SeriesDefaults.Renderer:= jqprBarRenderer;
IWCGJQPlot1.JQPlotOptions.SeriesDefaults.BarRendererOptions.VaryBarColor:= True;
IWCGJQPlot1.JQPlotOptions.AxesDefaults.TickRenderer:= jqptrCanvasAxisTickRenderer;
IWCGJQPlot1.JQPlotOptions.AxesDefaults.TickCanvasAxisOptions.Angle:= -30;
Axis:= IWCGJQPlot1.JQPlotOptions.Axes.Add;
Axis.AxisType:= jqpoxyXAxis;
Axis.Options.AxesRender:= jqparCategoryAxisRenderer;
end;


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 JQPlot

Who is online

Users browsing this forum: No registered users and 1 guest

Contact Us.