Stacked Bar Chart

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Errol
Newbie
Newbie
Posts: 75
Joined: Thu Jul 11, 2013 12:00 am

Re: Stacked Bar Chart

Post by Errol » Thu Feb 27, 2014 12:55 am

Good afternoon Yeray

Thanks for your reply. It appears I did not pose my previous question clearly enough - perhaps I did not use the correct terminology.

My program allows the selection of standard brush styles (e.g. bsSolid, bsHorizontal, etc), together with foreground and background colours. The selected brush style is stored in a field of a database table as a number from 0 to 7 (corresponding to the 8 standard brush styles), with the colours as integers. My questions are:
1. Is it possible to create a custom list of brush styles, using bitmaps?
2. If so, how do I implement this?
3. If not, how can I integrate the existing brush styles with brush images.

While this may not strictly be a TeeChart issue, I expected a wider range of brush styles available for your bar charts, so would appreciate assistance in this area.

Best regards

Errol

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Re: Stacked Bar Chart

Post by Narcís » Fri Feb 28, 2014 10:41 am

Hi Errol,

No, I don't think it is possible using current TeeChart functionality unless you modify or extend current TeeChart sources to support that. Maybe you could try overriding TTeeBrush class, implement additional functionality and replace brushes in your series with this new class.
Errol wrote: While this may not strictly be a TeeChart issue, I expected a wider range of brush styles available for your bar charts, so would appreciate assistance in this area.
This is a VCL's TBrushStyle limitation, I'm afraid. Anyway, which kind of brush styles would you like TeeChart to have? Feel free to submit your feature requests at Steema Software's bugzilla. Doing so you'll be notified of any update on the issue.

Thanks in advance.
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Errol
Newbie
Newbie
Posts: 75
Joined: Thu Jul 11, 2013 12:00 am

Re: Stacked Bar Chart

Post by Errol » Mon Mar 03, 2014 3:38 am

Hi Narcis

I am still having problems with your suggestions regarding editing Bar Chart legends, namely:
"You can either set the LegendStyle property or use the OnGetLegendText event to parse and remove it or Chart1.Legend.Items list as in the All Features\Welcome!\Miscellaneous\Legend\Items property."

I have two items showing in my Stacked Bar Chart legend, namely the Depth Increment (presumably a default setting) and the Rock Type (presumably set by XLabelsSource). I looked at the Chart.Legend.Items list and do not seem to be able to find a way of either editing the items or hiding one item in the list. I then looked at the OnGetLegendText event - this tells me that the LegendText has the typical form 100-TUF (depth increment followed by the rock type code), even though the legend is written as 100 TUF. However, the separator is clearly something different as I am unable to find it As each item of the legend has variable length, I cannot trim a fixed number of characters.

Regards

Errol

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

Re: Stacked Bar Chart

Post by Yeray » Mon Mar 03, 2014 2:31 pm

Hi Errol,

Your last reply seems to treat completely different issues to the discussed in the thread where you posted it. That's why I split it into a new thread.
Please, try to open a new thread for each different issue or problem to report. This makes things easier for us and for anyone with a similar problem looking for the solution suggested.
We'll reply the inquiries asap.
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

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

Re: Stacked Bar Chart

Post by Yeray » Mon Mar 03, 2014 3:08 pm

Hi Errol,
Errol wrote:I am still having problems with your suggestions regarding editing Bar Chart legends, namely:
"You can either set the LegendStyle property or use the OnGetLegendText event to parse and remove it or Chart1.Legend.Items list as in the All Features\Welcome!\Miscellaneous\Legend\Items property."

I have two items showing in my Stacked Bar Chart legend, namely the Depth Increment (presumably a default setting) and the Rock Type (presumably set by XLabelsSource). I looked at the Chart.Legend.Items list and do not seem to be able to find a way of either editing the items or hiding one item in the list. I then looked at the OnGetLegendText event - this tells me that the LegendText has the typical form 100-TUF (depth increment followed by the rock type code), even though the legend is written as 100 TUF. However, the separator is clearly something different as I am unable to find it As each item of the legend has variable length, I cannot trim a fixed number of characters.
I've made a simple example to test the items property. It seems to work perfectly for me here.
This Items list needs the chart to be drawn to be populated, that's why I edit it after forcing a chart repaint (Chart.Draw):

Code: Select all

uses Series;

procedure TForm1.FormCreate(Sender: TObject);
var i: Integer;
begin
  Chart1.View3D:=false;
  Chart1.Legend.Alignment:=laBottom;
  Chart1.Legend.CheckBoxes:=true;

  for i:=0 to 4 do
    with Chart1.AddSeries(TBarSeries) as TBarSeries do
    begin
      FillSampleValues(1);
      MultiBar:=mbStacked;
      MarksOnBar:=true;
      MarksLocation:=mlCenter;
    end;

  Chart1.Draw;
  for i:=0 to Chart1.Legend.Items.Count-1 do
    Chart1.Legend.Item[i].Text:='hello series ' + IntToStr(i);
end;
I understand you want to use checkboxes in the legend to show/hide bars in the chart. This works fine with lsSeries LegendStyle (or with lsAuto because it behaves as lsSeries when more than one series are active) but not with lsValues.
If you want to fully customize the Legend, you may want to check the CustomLegendTool. See the example at "What's New\Welcome !\New Chart Tools\Custom Legend Tool"
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