CGDevTools Forum

Welcome to the Official CGDevTools Support Community Forums.

Axis Scale

by MicroSolutions » 26 Apr 2016 15:36

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
MicroSolutions
 
Posts: 49
Joined: 22 Feb 2016 11:53

by Alexander Bulei » 26 Apr 2016 18:14

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.
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 MicroSolutions » 27 Apr 2016 16:22

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
MicroSolutions
 
Posts: 49
Joined: 22 Feb 2016 11:53

by Alexander Bulei » 27 Apr 2016 17:01

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.
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 MicroSolutions » 27 Apr 2016 17:06

Hi,

many thanks, this is exactly what I need!

Best regards,
MS
MicroSolutions
 
Posts: 49
Joined: 22 Feb 2016 11:53

by MicroSolutions » 28 Apr 2016 14:59

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
MicroSolutions
 
Posts: 49
Joined: 22 Feb 2016 11:53

by Alexander Bulei » 29 Apr 2016 10:17

Hi,

Define the TickInterval.

E.g:

delphi code
TempAxis.Options.TickInterval := 0.5;


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 MicroSolutions » 29 Apr 2016 12:28

Well, it does not solve the problem. Any other solution?

Best regards,
MS
MicroSolutions
 
Posts: 49
Joined: 22 Feb 2016 11:53

by Alexander Bulei » 29 Apr 2016 16:38

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.
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 2 guests

Contact Us.