Board index » delphi » TeeChart Legend size

TeeChart Legend size

I can't seem to display the vertical legend for a pie chart containing
28 points; the maximum seems to be 18. Any ideas how two vertical
legend columns can be displayed? Also, I can't find the TPieOtherSlice
component. I have 4.01 Pro.

Andrew

 

Re:TeeChart Legend size


Hi Andrew
The Legend has a TopPos property. Setting it to zero
uses the chart top to start the legend. The Legend font
size is the main parameter that controls the vertical
legend size.

When the legend is horizontal (top or bottom), it
can display multiple rows of values.

The TPieOtherSlice component is a subcomponent
of the PieSeries. It's defined in Series.pas

This code groups all pie slices below 10% of total
into a single slice:

Series1.OtherSlice.Style:=poBelowPercent;
Series1.OtherSlice.Value:=10;
Series1.OtherSlice.Text:='The very small ones';

--
Regards
David Berneda
http://www.teemach.com

Quote
Andrew Sowerby wrote in message ...
>I can't seem to display the vertical legend for a pie chart containing
>28 points; the maximum seems to be 18. Any ideas how two vertical
>legend columns can be displayed? Also, I can't find the TPieOtherSlice
>component. I have 4.01 Pro.

>Andrew

Re:TeeChart Legend size


David,

Thanks for that. Got it working now. The only problem is that when
switching from Pie to, say, a bar chart with the following code, all
points included in the 'other' slice are now contained within one bar
with gaps where the points contained in the slice should be. Any simple
way round this?

Also, I can't get a horizontal TeeScrollbar to scroll more that 14
points out of 28 when Points per Page is set to anything other than 0.
And the thumb always starts in the centre position (50%) even if the
scrollbar's Position property is set to 0.

Andrew

procedure TFormHrsRep.ToolButton1Click(Sender: TObject);
var
   tmp:TChartSeries;
begin
  tmp:= Series1;
  with Chart do begin
    case TToolButton(Sender).tag of
      1:ChangeSeriesType(tmp,TChartSeriesClass(TBarSeries));
      2:ChangeSeriesType(tmp,TChartSeriesClass(TAreaSeries));
      3:begin
         ChangeSeriesType(tmp,TChartSeriesClass(TLineSeries));
         TLineSeries(Series1).Pointer.visible:= true;
         end;
      4:ChangeSeriesType(tmp,TChartSeriesClass(TPieSeries));
    end;
  if TToolButton(Sender).tag = 4 then begin
    legend.Alignment:= laTop;
    legend.visible:= true;
    with TPieSeries(Series1).OtherSlice do begin
      Style:=poBelowValue;
      Value:= 50;
      Text:='Other < '+FloatToStr(Value);
      end;
    end
  else begin
    legend.visible:= false;
    if View3d then View3dOptions.Orthogonal:= true;
    tmp.ColorEachPoint:= false;
    end;
  end;
end;

Quote
> The TPieOtherSlice component is a subcomponent
> of the PieSeries. It's defined in Series.pas

> This code groups all pie slices below 10% of total
> into a single slice:

> Series1.OtherSlice.Style:=poBelowPercent;
> Series1.OtherSlice.Value:=10;
> Series1.OtherSlice.Text:='The very small ones';

Re:TeeChart Legend size


Hi Andrew
Ok. You can disable the "Other" feature before
changing to a Bar type.

The ScrollBar does not support yet multi paging.

--
Regards
David Berneda
http://www.teemach.com

Quote
Andrew Sowerby wrote in message ...
>David,

>Thanks for that. Got it working now. The only problem is that when
>switching from Pie to, say, a bar chart with the following code, all
>points included in the 'other' slice are now contained within one bar
>with gaps where the points contained in the slice should be. Any simple
>way round this?

>Also, I can't get a horizontal TeeScrollbar to scroll more that 14
>points out of 28 when Points per Page is set to anything other than 0.
>And the thumb always starts in the centre position (50%) even if the
>scrollbar's Position property is set to 0.

>Andrew

>procedure TFormHrsRep.ToolButton1Click(Sender: TObject);
>var
>   tmp:TChartSeries;
>begin
>  tmp:= Series1;
>  with Chart do begin
>    case TToolButton(Sender).tag of
>      1:ChangeSeriesType(tmp,TChartSeriesClass(TBarSeries));
>      2:ChangeSeriesType(tmp,TChartSeriesClass(TAreaSeries));
>      3:begin
>         ChangeSeriesType(tmp,TChartSeriesClass(TLineSeries));
>         TLineSeries(Series1).Pointer.visible:= true;
>         end;
>      4:ChangeSeriesType(tmp,TChartSeriesClass(TPieSeries));
>    end;
>  if TToolButton(Sender).tag = 4 then begin
>    legend.Alignment:= laTop;
>    legend.visible:= true;
>    with TPieSeries(Series1).OtherSlice do begin
>      Style:=poBelowValue;
>      Value:= 50;
>      Text:='Other < '+FloatToStr(Value);
>      end;
>    end
>  else begin
>    legend.visible:= false;
>    if View3d then View3dOptions.Orthogonal:= true;
>    tmp.ColorEachPoint:= false;
>    end;
>  end;
>end;

>> The TPieOtherSlice component is a subcomponent
>> of the PieSeries. It's defined in Series.pas

>> This code groups all pie slices below 10% of total
>> into a single slice:

>> Series1.OtherSlice.Style:=poBelowPercent;
>> Series1.OtherSlice.Value:=10;
>> Series1.OtherSlice.Text:='The very small ones';

Re:TeeChart Legend size


David,

Thanks for that. I really need the scrollbar to handle multi-paging, is it planned to be 'fixed'
in V4.02 or do we have to wait for v5?

Andrew

Quote
> Ok. You can disable the "Other" feature before
> changing to a Bar type.

> The ScrollBar does not support yet multi paging.

Other Threads