简体   繁体   中英

Make chart fill size of browser window

Screenshot

I have a C# program which uses Plotly.NET to set up a candlestick chart of the S&P data.

It's shown below in a browser window:

在此处输入图像描述

Question

Is there a way to get it to be larger? Perhaps a way to get it to fill the window?

Responsive charts

The documentation has a section regarding Responsive charts :

在此处输入图像描述

Here's the code I'm using to setup the chart:

Chart2D.Chart.Candlestick<string>(seq)

    .WithYAxis(LinearAxis.init<IConvertible, IConvertible, IConvertible, IConvertible, IConvertible, IConvertible>(
        FixedRange: false))

    .WithConfig(Config.init(Responsive: true))

    .Show();

However, the resulting chart is still a fixed size.

Code

Here's a link to the full program, if you'd like to try it out.

The size of the chart can be changed via WithSize as shown below:

Chart2D.Chart.Candlestick<string>(seq)

    .WithYAxis(LinearAxis.init<IConvertible, IConvertible, IConvertible, IConvertible, IConvertible, IConvertible>(
        FixedRange: false))

    .WithConfig(Config.init(Responsive: true))

    .WithSize(1800, 900)

    .Show();

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM