Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
125
Leave space to the left and right
posted

Hi,

I am having only one column to display and its occupying the whole graph area (Kind of horizontal graph). Is there a way to leave space to the left and right of the graph and make the graph more vertical than filling up the entire space. Thanks. 

  • 17605
    Verified Answer
    posted

    You can try using ChartDrawItem Event. The code could be something like:

    this.ultraChart1.ChartDrawItem += new Infragistics.UltraChart.Shared.Events.ChartDrawItemEventHandler(ultraChart1_ChartDrawItem);

    ...

    private const int columnWidth = 100;

    ...

    void ultraChart1_ChartDrawItem(object sender, Infragistics.UltraChart.Shared.Events.ChartDrawItemEventArgs e)

    {

    Box box = e.Primitive as Box;

    if (box == null)

    {

    return;

    }

    if (box.DataPoint == null)

    {

    return;

    }

    int dWidth = box.rect.Width - columnWidth;if (dWidth <= 0)

    {

    return;

    }

    box.rect.Width = columnWidth;

    box.rect.X += dWidth / 2;

    }