Incorrect Legend totals

TeeChart FireMonkey (Windows,OSX,iOS & Android) for Embarcadero RAD Studio, Delphi and C++ Builder (XE5+)
Post Reply
realsol
Newbie
Newbie
Posts: 70
Joined: Mon Feb 27, 2017 12:00 am

Incorrect Legend totals

Post by realsol » Mon Apr 03, 2017 3:31 pm

I have a two series bar chart that displays Income and Expenses. I was given some code (i think on another ticket) that calculated my two series for the legend. But now, it only works when Income or Income and Expenses are displayed, but not when income is displayed by itself.

Here is the code I am using in the Charts GetLegendText event:

Code: Select all

if Index < DBChart2.SeriesCount then
    LegendText:= ' $' + FormatFloat('#,##0.00', DBChart2[Index].YValues.Total) + '   ' + LegendText;
It hits the code. Otherwise, there wouldn't be a dollar sign. So a few questions regarding this chart:

1. How can I fix the about code to calculate the legend correctly?
2. I would like to click on the X Labels if possible. Is there a way I can use an event when a user clicks on the dates below the chart?

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

Re: Incorrect Legend totals

Post by Yeray » Tue Apr 04, 2017 9:34 am

Hello,
realsol wrote:I have a two series bar chart that displays Income and Expenses. I was given some code (i think on another ticket) that calculated my two series for the legend
It was here:
http://www.teechart.net/support/viewtop ... 266#p73266
realsol wrote:But now, it only works when Income or Income and Expenses are displayed, but not when income is displayed by itself.
I'm not sure to understand the problem. Could you please arrange a simple example project we can run as-is to reproduce the problem here?
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