0
votes

I am using Teechart to draw some point series, but the default canvas of the Teechart graph shown to be stretch entire area. I would like to add margin between Axis and plot point series. So, it look proportional to the window.

Here sample codes:

    m_ptChart->GetWalls()->GetBack()->PutTransparent(FALSE);
    m_ptChart->GetWalls()->GetBack()->PutColor(RGB(255, 255, 255));
    m_ptChart->GetZoom()->GetPen()->PutColor(RGB(0, 0, 0));
    m_ptChart->SetTheme(tchartNS::ctDefault, tchartNS::cpSolid);

    // Setup Drawing canvas
    m_ptChart->GetCanvas()->PutUseAntiAlias(VARIANT_TRUE);
    m_ptChart->GetCanvas()->PutUseBuffer(VARIANT_TRUE);
    m_ptChart->GetAxis()->GetTop()->Maximum = (double)MaxPoints();
    m_ptChart->GetAxis()->PutDrawAxesBeforeSeries(VARIANT_TRUE);
}

// Add some series into the chart   
for (int i = 0; i < 12; i++)
{
    m_ptChart->AddSeries(scPoint);
    m_ptChart->Series(i)->Add(i*2, _T("Test1"), RGB(255 - i, 34, 128));
    m_ptChart->Series(i)->Add(i * 2, _T("Test2"), RGB(153 - i, 232, 173));
    m_ptChart->Series(i)->asPoint->GetPointer()->PutStyle((EPointerStyle)i);
    m_ptChart->Series(i)->asPoint->GetPointer()->VerticalSize = 10;
    m_ptChart->Series(i)->asPoint->GetPointer()->HorizontalSize = 10;

}
1

1 Answers

0
votes

You can do something as in the All Features\Welcome!\Axes\Isometric Axes example at the features demo, available at TeeChart's program group. Here you'll find an example on how to get the canvas handle in Visual C++. If that's not what you are looking for please provide more detailed information.