DocX
DocX copied to clipboard
Chart size
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);
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.
Hi, The LineChart series color will be fixed in v1.7.
Margin and Padding will work when setting the WrappingStyle property. This feature will be part of v2.1.