Teechart传奇风格

时间:2013-10-16 09:25:43

标签: activex teechart

在我的代码中,当用户点击系列栏时,要求将系列的CheckBox样式更改为无。但是当我这样做时,我的图表宽度正在增加。有没有办法我们可以保持图表宽度不受图例宽度的影响。

由于 阿克沙伊

2 个答案:

答案 0 :(得分:1)

在底部设置图例对齐以避免图表的宽度增量,如下所示。 Chart.GetLegend()参考setAlignment(laBottom);

如果您想要图例的自定义位置(图表的右侧),那么您可以执行以下操作。   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); //用于避免图例和图表重叠 您还可以通过修改上面的值

来微调您的图例和图表

答案 1 :(得分:1)

这可以做到

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