Export (0) Print
Expand All

Chart.Width Property

Gets or set the width, in pixels, of the chart image.

Namespace:  System.Web.Helpers
Assembly:  System.Web.Helpers (in System.Web.Helpers.dll)

public int Width { get; }

Property Value

Type: System.Int32
The chart width.

The following example shows how to use the Width property to create a chart image of a specific width.


@{ 
    var basicChart = new Chart(width: 600, height: 400) 
        .AddTitle("Chart Title") 
        .AddSeries( 
            name: "Employee", 
            xValue: new[] {  "Peter", "Andrew", "Julie", "Mary", "Dave" }, 
            yValues: new[] { "2", "6", "4", "5", "3" }) 
        .Write(); 
}


  • Medium trust for the immediate caller. This member can be used by partially trusted code.
Show:
© 2015 Microsoft