Extra whitespace at top of chart

Posted by: sslocum on 17 June 2019, 4:44 pm EST

    • Post Options:
    • Link

    Posted 17 June 2019, 4:44 pm EST - Updated 4 October 2022, 1:08 am EST

    Hi,

    I am seeing extra whitespace at the top of my chart that I can’t seem to get rid of. That page of my report is crowded so I need to reclaim that space. I tried setting C1Chart.Padding.Top and C1Chart.Margin.Top but got compile errors stating that “Expression is a value and therefore cannot be the target of an assignment”. I will attach a screen shot showing that there is only a pixel or so of whitespace in the designer, but then roughly an inch of whitespace at runtime. Thank you!

    Steve

  • Posted 18 June 2019, 7:18 am EST

    Hi Steve,

    C1Chart, by design, keeps some gap between ChartArea bounds and the chart bounds. So, to remove this gap you can set the ChartArea.Location to (0,0) and ChartArea.Size to the Size of the C1Chart itself.

    _chart.ChartArea.Location = new Point(0, 0);
    _chart.ChartArea.Size = _chart.Size;
    

    Also, C1Chart.Padding.Top and C1Chart.Margin.Top are values not variables so they can not used for assignment. Instead, whenever needed, you should set the Padding/Margin as a whole:

    _chart.Margin = new Padding(0);
    
    

    Thanks,

    Basant

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels