Page 1 of 1

Axis Scale

PostPosted: 26 Apr 2016 15:36
by MicroSolutions
Hi,

I have problems with using ticks on an axis in Delphi. If I set the axis min/max values from code and I add some ticks, the axis does not use the min/max values anymore. How can I avoid this behaviour?

Next question is: how can I use the 'forceTickAt0' and 'forceTickAt100' from Delphi code? I did not find any sample code. I found it here:

http://www.jqplot.com/examples/axisScal ... ickAt.php#

Thanks in advance,
MS

Re: Axis Scale

PostPosted: 26 Apr 2016 18:14
by Alexander Bulei
Hi MicroSolutions,

It's a little complex component, so better, you provide us the simple testcase project to check what are you doing wrong (if case).

Best Regards.

Re: Axis Scale

PostPosted: 27 Apr 2016 16:22
by MicroSolutions
Ok then, here is the simple question. How can I use the forceTickAt0 and forceTickAt100 options (see the following sample code) from Delphi:

$(document).ready(function(){
plot4 = $.jqplot('chart4',[makeContinuousData(20, 40, 5)], {
axesDefaults: {
pad: 0
},
axes: {
yaxis: {
rendererOptions: { forceTickAt0: true, forceTickAt100: true }
}
}
});
});

Thanks in advance,
MS

Re: Axis Scale

PostPosted: 27 Apr 2016 17:01
by Alexander Bulei
Hi,

At this moment, possible only with typecase:

delphi code
with IWCGJQPlot1.JQPlotOptions.Axes.Add do
begin
AxisType:= jqpoxyYAxis;
Options.AxesRender:= jqparLinearAxisRenderer;
(Options.AxesRenderOptions as TIWCGJQPlotLinearAxisRendererOptions).ForceTickAt0:= True;
end;


We will implement the necessaries properties "links" in next beta build.

Thanks.

Best Regards.

Re: Axis Scale

PostPosted: 27 Apr 2016 17:06
by MicroSolutions
Hi,

many thanks, this is exactly what I need!

Best regards,
MS

Re: Axis Scale

PostPosted: 28 Apr 2016 14:59
by MicroSolutions
Hi,

here is the sample code for the other question. So, there is a bar chart. If I add ticks on an axis, it won't use the Min/Max values anymore.

Without the ticks:

Image

And with the added ticks:

Image

And here is the sample code:

pascal code
procedure TIWForm1.IWAppFormShow(Sender: TObject);
var
TempAxis: TIWCGJQPlotOptionsAxesItem;
TempSeries: TIWCGJQPlotOptionsSeriesDefaults;
I: Integer;
begin
// Left Axis
TempAxis := IWCGJQPlot1.JQPlotOptions.Axes.Add;
TempAxis.AxisType := jqpoxyYAxis;
TempAxis.Options.AxesRender := jqparLinearAxisRenderer;
TempAxis.Options.Min := 0;
TempAxis.Options.Max := 250;

// Bottom Axis
TempAxis := IWCGJQPlot1.JQPlotOptions.Axes.Add;
TempAxis.AxisType := jqpoxyXAxis;
TempAxis.Options.AxesRender := jqparLinearAxisRenderer;
TempAxis.Options.Min := 0.5;
TempAxis.Options.Max := 9.5;

// Remove the comments to add the ticks...
// for I := 1 to 9 do
// TempAxis.Options.Ticks.Add(IntToStr(I));

TempSeries := IWCGJQPlot1.JQPlotOptions.Series.Add;
TempSeries.Renderer := jqprBarRenderer;
TempSeries.BarRendererOptions.BarWidth := 32;
TempSeries.BarRendererOptions.VaryBarColor := True;

IWCGJQPlot1.JQPlotData := '[[[1,225],[2,110],[3,195],[4,202.5],[5,155],[6,77.5],[7,192.5],[8,150],[9,145]]]';
end;


How can I avoid this behaviour?

Thanks in advance,
MS

Re: Axis Scale

PostPosted: 29 Apr 2016 10:17
by Alexander Bulei
Hi,

Define the TickInterval.

E.g:

delphi code
TempAxis.Options.TickInterval := 0.5;


Best Regards.

Re: Axis Scale

PostPosted: 29 Apr 2016 12:28
by MicroSolutions
Well, it does not solve the problem. Any other solution?

Best regards,
MS

Re: Axis Scale

PostPosted: 29 Apr 2016 16:38
by Alexander Bulei
Hi,

Well, it does not solve the problem.


Then I didn't realize your problem :(
Please try to explain better, and what are you expect.

Best Regards.