CircularGauge axis labels

TeeChart for ActiveX, COM and ASP
Post Reply
Tero
Newbie
Newbie
Posts: 7
Joined: Wed Mar 30, 2016 12:00 am
Contact:

CircularGauge axis labels

Post by Tero » Fri Sep 16, 2016 7:38 am

For f.ex. line series I use "GetAxisLabels" event to modify labels. The same method does not seem to work for circular gauge series internal axis. Java version seems to have "AxisLabelResolver" and "AxisLabelAdapter" combo which can be used to do this (according to forum posts I found using forum search engine) but ActiveX API does not seem to have these methods.

Is there a way to modify circular gauge labels? The problem I have is that numerical values to be shown on gauge are very large (and the range is large too) so I'd like to modify them like 500 k, 50 M, 5 G and so on based on numerical value without the need to modify actual values.

Another problem. Using gauge.GetRanges().GetItems(0) etc. call seems to generate access violation fault or something similar. So I cannot add or modify ranges. I can only use GetGreenLine() and GetRedLine() function calls i.e. two ranges max.

Using latest 2016.0.0.2 release.

Yeray
Site Admin
Site Admin
Posts: 9614
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: CircularGauge axis labels

Post by Yeray » Mon Sep 19, 2016 10:00 am

Hello,

This comes from TeeChart VCL so I've added it to its public tracker:
http://bugs.teechart.net/show_bug.cgi?id=1634
Tero wrote:Another problem. Using gauge.GetRanges().GetItems(0) etc. call seems to generate access violation fault or something similar. So I cannot add or modify ranges. I can only use GetGreenLine() and GetRedLine() function calls i.e. two ranges max.
Note by default you have two Ranges (indexes 0 and 1), and you can add a third (index 2). Ie this works for me:

Code: Select all

  TChart1.AddSeries scCircularGauge
  
  With TChart1.Series(0).asCircularGauge
    .Ranges.Items(0).EndValue = 50
    .Ranges.Items(1).StartValue = 90
    .Ranges.Add 60, 80, clTeeColor
    With .Ranges.Items(2)
      .Format.Gradient.StartColor = vbYellow
      .Format.Gradient.EndColor = vbRed
    End With
  End With
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Tero
Newbie
Newbie
Posts: 7
Joined: Wed Mar 30, 2016 12:00 am
Contact:

Re: CircularGauge axis labels

Post by Tero » Mon Sep 19, 2016 11:05 am

Using VS2012 C++ code line:

gauge.GetRanges().GetItems(0);

causes an access violation when InvokeHelper is called:

CGaugeRange CGaugeRanges::GetItems(long Index)
{
LPDISPATCH pDispatch;
static BYTE parms[] =
VTS_I4;
InvokeHelper(0xc9, DISPATCH_PROPERTYGET, VT_DISPATCH, (void*)&pDispatch, parms,
Index);
return CGaugeRange(pDispatch);
}
Crash.png
Crash.png (28.04 KiB) Viewed 12838 times

Tero
Newbie
Newbie
Posts: 7
Joined: Wed Mar 30, 2016 12:00 am
Contact:

Re: CircularGauge axis labels

Post by Tero » Wed Sep 21, 2016 7:31 am

Another question. Is it possible to make axis labels drawn so that they are always inside face area not over axis area:
Labels.png
Labels.png (28.09 KiB) Viewed 12848 times
This does not look good!

Yeray
Site Admin
Site Admin
Posts: 9614
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: CircularGauge axis labels

Post by Yeray » Wed Sep 21, 2016 9:13 am

Hello,
Tero wrote:Using VS2012 C++ code line:

gauge.GetRanges().GetItems(0);

causes an access violation when InvokeHelper is called:
I've reproduced that problem with VC++, while it seems to work fine in VB6.
I've added it to the public tracker:
http://bugs.teechart.net/show_bug.cgi?id=1635
Tero wrote:Another question. Is it possible to make axis labels drawn so that they are always inside face area not over axis area:
It seems to be this issue:
http://bugs.teechart.net/show_bug.cgi?id=833

Please, open different threads for different issues.
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Post Reply