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);
 }
Exemplo n.º 2
0
        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;
        }
Exemplo n.º 3
0
        /// <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;
        }
Exemplo n.º 4
0
        /// <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[]>();
        }
Exemplo n.º 5
0
        public void StrokeThickness_SetValidValue_ValueSet(int validValue)
        {
            // Setup
            var polygonStyle = new ChartAreaStyle();

            // Call
            polygonStyle.StrokeThickness = validValue;

            // Assert
            Assert.AreEqual(validValue, polygonStyle.StrokeThickness);
        }
Exemplo n.º 6
0
        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);
        }
Exemplo n.º 7
0
        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);
        }
Exemplo n.º 8
0
        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);
        }
Exemplo n.º 9
0
        /// <summary>
        /// Configures the line style for area series.
        /// </summary>
        /// <param name="style">The style. The default is normal.</param>
        /// <example>
        /// <code lang="CS">
        /// &lt;%= Html.Kendo().Chart()
        ///            .Name("Chart")
        ///            .Series(series => series
        ///                .Area(s => s.Sales)
        ///                .Line(line => line.Style(ChartAreaStyle.Step))
        ///            )
        /// %&gt;
        /// </code>
        /// </example>
        public ChartAreaLineBuilder Style(ChartAreaStyle style)
        {
            line.Style = style;

            return(this);
        }
Exemplo n.º 10
0
        /// <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">
        /// &lt;% Html.Kendo().Chart()
        ///           .Name("Chart")
        ///           .Series(series => series
        ///               .Area(s => s.Sales)
        ///               .Line(2, "red", ChartDashType.Dot, ChartAreaStyle.Smooth)
        ///           )
        ///           .Render();
        /// %&gt;
        /// </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);
        }
Exemplo n.º 11
0
        /// <summary>
        /// Configures the line style for area series.
        /// </summary>
        /// <param name="style">The style. The default is normal.</param>
        /// <example>
        /// <code lang="CS">
        /// &lt;%= Html.Kendo().Chart()
        ///            .Name("Chart")
        ///            .Series(series => series
        ///                .Area(s => s.Sales)
        ///                .Line(line => line.Style(ChartAreaStyle.Step))
        ///            )
        /// %&gt;
        /// </code>
        /// </example>
        public ChartAreaLineBuilder Style(ChartAreaStyle style)
        {
            line.Style = style;

            return this;
        }