private static void AssertEqualStyle(ChartAreaStyle areaStyle, Color fillColor, Color strokeColor, int width, bool isEditable) { Assert.AreEqual(fillColor, areaStyle.FillColor); Assert.AreEqual(strokeColor, areaStyle.StrokeColor); Assert.AreEqual(width, areaStyle.StrokeThickness); Assert.AreEqual(isEditable, areaStyle.IsEditable); }
protected override void SetSeriesStyle(ChartAreaData data, AreaSeries series) { ChartAreaStyle style = data.Style; series.Fill = ChartDataHelper.Convert(style.FillColor); series.Color = ChartDataHelper.Convert(style.StrokeColor); series.StrokeThickness = style.StrokeThickness; }
/// <summary> /// Creates a new instance of <see cref="ChartAreaData"/>. /// </summary> /// <param name="name">The name of the <see cref="ChartAreaData"/>.</param> /// <param name="style">The style of the data.</param> /// <exception cref="ArgumentException">Thrown when <paramref name="name"/> is /// <c>null</c> or only whitespace.</exception> /// <exception cref="ArgumentNullException">Thrown when <paramref name="style"/> /// is <c>null</c>.</exception> public ChartAreaData(string name, ChartAreaStyle style) : base(name) { if (style == null) { throw new ArgumentNullException(nameof(style)); } Style = style; }
/// <summary> /// Creates a new instance of <see cref="ChartMultipleAreaData"/>. /// </summary> /// <param name="name">The name of the <see cref="ChartMultipleAreaData"/>.</param> /// <param name="style">The style of the data.</param> /// <exception cref="ArgumentException">Thrown when <paramref name="name"/> is /// <c>null</c> or only whitespace.</exception> /// <exception cref="ArgumentNullException">Thrown when <paramref name="style"/> /// is <c>null</c>.</exception> public ChartMultipleAreaData(string name, ChartAreaStyle style) : base(name) { if (style == null) { throw new ArgumentNullException(nameof(style)); } Style = style; Areas = new List <Point2D[]>(); }
public void StrokeThickness_SetValidValue_ValueSet(int validValue) { // Setup var polygonStyle = new ChartAreaStyle(); // Call polygonStyle.StrokeThickness = validValue; // Assert Assert.AreEqual(validValue, polygonStyle.StrokeThickness); }
public void StrokeThickness_SetInvalidValue_ThrowsArgumentOutOfRangeException(int invalidValue) { // Setup var polygonStyle = new ChartAreaStyle(); // Call TestDelegate test = () => polygonStyle.StrokeThickness = invalidValue; // Assert const string message = "De waarde voor lijndikte moet in het bereik [0, 48] liggen."; TestHelper.AssertThrowsArgumentExceptionAndTestMessage <ArgumentOutOfRangeException>(test, message); }
public void Constructor_WithStyle_ExpectedValue() { // Setup var style = new ChartAreaStyle(); // Call var data = new ChartMultipleAreaData("test data", style); // Assert Assert.AreEqual("test data", data.Name); CollectionAssert.IsEmpty(data.Areas); Assert.IsInstanceOf <ChartData>(data); Assert.AreSame(style, data.Style); }
public void Constructor_WithAllParameters_SetsProperties() { // Setup Color fillColor = Color.AliceBlue; Color strokeColor = Color.Blue; const int width = 3; // Call var areaStyle = new ChartAreaStyle { FillColor = fillColor, StrokeColor = strokeColor, StrokeThickness = width, IsEditable = true }; // Assert Assert.AreEqual(fillColor, areaStyle.FillColor); Assert.AreEqual(strokeColor, areaStyle.StrokeColor); Assert.AreEqual(width, areaStyle.StrokeThickness); Assert.IsTrue(areaStyle.IsEditable); }
/// <summary> /// Configures the line style for area series. /// </summary> /// <param name="style">The style. The default is normal.</param> /// <example> /// <code lang="CS"> /// <%= Html.Kendo().Chart() /// .Name("Chart") /// .Series(series => series /// .Area(s => s.Sales) /// .Line(line => line.Style(ChartAreaStyle.Step)) /// ) /// %> /// </code> /// </example> public ChartAreaLineBuilder Style(ChartAreaStyle style) { line.Style = style; return(this); }
/// <summary> /// Configures the area chart line. /// </summary> /// <param name="width">The line width.</param> /// <param name="color">The line color.</param> /// <param name="dashType">The line dashType.</param> /// <param name="style">The line style.</param> /// <example> /// <code lang="CS"> /// <% Html.Kendo().Chart() /// .Name("Chart") /// .Series(series => series /// .Area(s => s.Sales) /// .Line(2, "red", ChartDashType.Dot, ChartAreaStyle.Smooth) /// ) /// .Render(); /// %> /// </code> /// </example> public ChartAreaSeriesBuilder <T> Line(int width, string color, ChartDashType dashType, ChartAreaStyle style) { Series.Line.Width = width; Series.Line.Color = color; Series.Line.DashType = dashType; Series.Line.Style = style; return(this); }
/// <summary> /// Configures the line style for area series. /// </summary> /// <param name="style">The style. The default is normal.</param> /// <example> /// <code lang="CS"> /// <%= Html.Kendo().Chart() /// .Name("Chart") /// .Series(series => series /// .Area(s => s.Sales) /// .Line(line => line.Style(ChartAreaStyle.Step)) /// ) /// %> /// </code> /// </example> public ChartAreaLineBuilder Style(ChartAreaStyle style) { line.Style = style; return this; }