Akshay Bhalla
Akshay Bhalla

Reputation: 145

Teechart Legend Style

In My Code there is requirement when user click on a Bar of a series the CheckBox Style of the Series should be changed to none.But when i do that my Chart Width is increasing. IS there any way we can keep the chart width fix irrespective of legend table width.

Thanks Akshay

Upvotes: 0

Views: 289

Answers (2)

saroj kumar
saroj kumar

Reputation: 330

Set your legend Alignment in bottom for Avoiding width increment of chart as below. Chart.GetLegend().SetAlignment(laBottom);

if you want custom position of legend (Right side of chart)then you can do as below. m_Chart1.GetLegend().SetCustomPosition(TRUE);

m_Chart1.GetLegend().SetPositionUnits(muPercent);

m_Chart1.GetLegend().SetTopPercent(20); long leftmargin = 80.0; m_Chart1.GetLegend().SetLeftPercent(leftmargin );

m_Chart1.GetPanel().SetMarginRight(100-leftmargin+1);//for avoiding overlapping of legend and chart Also you can finetune your legend and chart by modifying above value

Upvotes: 1

Akshay Bhalla
Akshay Bhalla

Reputation: 145

This Can be done

    GetLegend().SetResizeChart(false);
    GetLegend().SetCustomPosition(true);
    GetLegend().SetPositionUnits(muPercent);
    GetLegend().SetLeftPercent(83);
    GetLegend().SetTopPercent(10);

Upvotes: 1

Related Questions