question

gregchu-9014 avatar image
0 Votes"
gregchu-9014 asked gregchu-9014 commented

Change chart size for dot net Core 5

I setup a win form project on dot net Core 5, and successfully draw a candlestick chart, but the size of the chart is too small (see attachments), and not really visible, some one please download the code and run it and let me know how to change the size of the chart so it is visible, dot net Core 5 no longer support chart control, so only can change in code.


127711-workingchartema.txt

Please install the following 2 Nuget packages
Skender.Stock.Indicators

HIC.System.Windows.Forms.DataVisualization

127559-2021-08-30-13-40-41.jpg


dotnet-csharp
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

TimonYang-MSFT avatar image
0 Votes"
TimonYang-MSFT answered gregchu-9014 commented

I did a test. We can use this.chart1.Size = new Size(300, 100); to modify the size of the chart.

But I checked your code, you wrote this code twice:

         this.chart1.Size = new System.Drawing.Size(300, 100);
         this.chart1.TabIndex = 0;
         this.chart1.Text = "chart1";
         this.chart1.Size = new System.Drawing.Size(353, 428);

Is the second one redundant? Did you only modify the first one?


If the response is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Great, changed to size to 1200 and and it is readable now.


127898-2021-08-31-7-02-26.jpg


0 Votes 0 ·