DocX icon indicating copy to clipboard operation
DocX copied to clipboard

Chart size

Open cristianmarian95 opened this issue 6 years ago • 3 comments

How you can set the chart size, color for lines and the padding or margin for it. I can't find any docs about it i try to change color, here is a some of my code.

// Create the LineChart instance 
            LineChart chart = new LineChart();
            Series series = new Series("Number of violated rules and directives");

            //Set the color
            series.Color = Color.Black;

            // Create a new list of ChartModel
            var chartData = new List<Models.ChartModel>();
            chartData.Add(new ChartModel { date = "02.30", violation = 1000 }); // Insert data into the list 
            chartData.Add(new ChartModel { date = "06.30", violation = 3000 }); // Insert data into the list 
            chartData.Add(new ChartModel { date = "07.30", violation = 100 });  // Insert data into the list 

            series.Bind(chartData, "date", "violation"); // Insert the data into the chart 
            chart.AddSeries(series);                     // Add the series instance to the chart 
            document.InsertChart(chart);

cristianmarian95 avatar Dec 07 '18 12:12 cristianmarian95

Hi,

Starting at v1.4, you can insert the chart by specifying its width and height. See the release notes (https://xceed.com/release-notes/#words-net-1.4.17620.09420).

The color is not working in the LineChart, (same as https://github.com/xceedsoftware/DocX/issues/203). The Margin/Padding is not working. We will try to find out why.

You can try the latest version for free for 45 days here : https://xceed.com/xceed-words-for-net/ Thank you.

XceedBoucherS avatar Jan 11 '19 14:01 XceedBoucherS

Hi, The LineChart series color will be fixed in v1.7.

XceedBoucherS avatar Jan 29 '19 19:01 XceedBoucherS

Margin and Padding will work when setting the WrappingStyle property. This feature will be part of v2.1.

XceedBoucherS avatar May 17 '21 14:05 XceedBoucherS