Change chart size for dot net Core 5

greg chu 116 Reputation points
2021-08-30T18:04:43.713+00:00

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

C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,098 questions
{count} votes

Accepted answer
  1. Timon Yang-MSFT 9,571 Reputation points
    2021-08-31T06:05:43.733+00:00

    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.


0 additional answers

Sort by: Most helpful