Page 1 of 1

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

PostPosted: 19 Sep 2014 20:46
by dfields
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';

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

PostPosted: 19 Sep 2014 22:48
by Jorge Sousa
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?

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

PostPosted: 22 Sep 2014 11:53
by Alexander Bulei
Hi dfields,

Do you need something like this?

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


Best Regards.

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

PostPosted: 22 Sep 2014 18:54
by dfields
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?

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

PostPosted: 23 Sep 2014 09:21
by Alexander Bulei
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.