Page 1 of 1

CircularGauge axis labels

Posted: Fri Sep 16, 2016 7:38 am
by 16677910
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.

Re: CircularGauge axis labels

Posted: Mon Sep 19, 2016 10:00 am
by yeray
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

Re: CircularGauge axis labels

Posted: Mon Sep 19, 2016 11:05 am
by 16677910
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 11371 times

Re: CircularGauge axis labels

Posted: Wed Sep 21, 2016 7:31 am
by 16677910
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 11381 times
This does not look good!

Re: CircularGauge axis labels

Posted: Wed Sep 21, 2016 9:13 am
by yeray
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.