Exemplo n.º 1
0
        protected override void SetSeriesStyle(ChartLineData data, LineSeries series)
        {
            ChartLineStyle style = data.Style;

            series.Color           = ChartDataHelper.Convert(style.Color);
            series.StrokeThickness = style.Width;
            series.LineStyle       = ChartDataHelper.Convert(style.DashStyle);
        }
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
        public void Convert_ValidChartPointSymbol_ReturnsExpectedMarkerType(ChartPointSymbol chartPointSymbol,
                                                                            MarkerType expectedMarkerType)
        {
            // Call
            MarkerType markerType = ChartDataHelper.Convert(chartPointSymbol);

            // Assert
            Assert.AreEqual(expectedMarkerType, markerType);
        }
Exemplo n.º 4
0
        public void Convert_ValidChartLineDashStyle_ReturnsExpectedLineStyle(ChartLineDashStyle chartLineDashStyle,
                                                                             LineStyle expectedLineStyle)
        {
            // Call
            LineStyle lineStyle = ChartDataHelper.Convert(chartLineDashStyle);

            // Assert
            Assert.AreEqual(expectedLineStyle, lineStyle);
        }
Exemplo n.º 5
0
        /// <summary>
        /// Converts all general properties of <see cref="RowChartData"/>
        /// from <paramref name="data"/> to <paramref name="series"/>.
        /// </summary>
        /// <param name="data">The row chart data to convert the general properties from.</param>
        /// <param name="series">The series to convert the general properties to.</param>
        /// <exception cref="ArgumentNullException">Thrown when <paramref name="data"/>
        /// or <paramref name="series"/> is <c>null</c>.</exception>
        public static void ConvertSeriesProperties(RowChartData data, ColumnSeries series)
        {
            ValidateParameters(data, series);

            series.Title = data.Name;

            if (data.Color.HasValue)
            {
                series.FillColor = ChartDataHelper.Convert(data.Color.Value);
            }
        }
Exemplo n.º 6
0
        protected override void SetSeriesStyle(ChartPointData data, LineSeries series)
        {
            series.LineStyle = LineStyle.None;
            ChartPointStyle style = data.Style;

            series.MarkerFill            = ChartDataHelper.Convert(style.Color);
            series.MarkerSize            = style.Size;
            series.MarkerType            = ChartDataHelper.Convert(style.Symbol);
            series.MarkerStroke          = ChartDataHelper.Convert(style.StrokeColor);
            series.MarkerStrokeThickness = style.StrokeThickness;
        }
Exemplo n.º 7
0
        public void Convert_Color_ReturnsOxyColor(KnownColor knownColor)
        {
            // Setup
            Color color = Color.FromKnownColor(knownColor);

            // Call
            OxyColor oxyColor = ChartDataHelper.Convert(color);

            // Assert
            OxyColor originalColor = OxyColor.FromArgb(color.A, color.R, color.G, color.B);

            Assert.AreEqual(originalColor, oxyColor);
        }
Exemplo n.º 8
0
        public void Convert_InvalidChartLineDashStyle_ThrowsInvalidEnumArgumentException()
        {
            // Setup
            const int invalidValue = 100;

            // Call
            TestDelegate call = () => ChartDataHelper.Convert((ChartLineDashStyle)invalidValue);

            // Assert
            string expectedMessage = $"The value of argument 'dashStyle' ({invalidValue}) is invalid for Enum type '{nameof(ChartLineDashStyle)}'.";
            string parameterName   = TestHelper.AssertThrowsArgumentExceptionAndTestMessage <InvalidEnumArgumentException>(call, expectedMessage).ParamName;

            Assert.AreEqual("dashStyle", parameterName);
        }