Linq chart set Xmin and Xmax


#1

Hello,
when using linq chart as described here https://docs.aspose.com/display/wordsnet/Template+Syntax#TemplateSyntax-UsingChartstoRepresentSequentialData

is there a way to automatically arrange the xmin and xmax based on the data bound to the chart ? if not available by default, how can we change by code xmin/xmax of an existing chart ? (in the documentation i only see the option to insert a new chart and manipulate it)


#2

@miniseb31

Unfortunately, Aspose.Words does not provide the requested feature. Could you please share your input and expected output Word documents? We will then log this feature in our issue tracking system according your requirement.


#3

at least is it possible to open an existing word document and manipulate an existing chart ?

i would like to change the minimimum and maximum. I dont understand why 0 is set when i am in automatic.

image.png (56.2 KB)


#4

@miniseb31

We have logged this feature request as WORDSNET-18571 in our issue tracking system. You will be notified via this forum thread once this feature is available.

We apologize for your inconvenience.


#5

any news for this request ?


#6

@miniseb31

We try our best to deal with every customer request in a timely fashion, we unfortunately cannot guarantee a delivery date to every customer issue. We work on issues on a first come, first served basis. We feel this is the fairest and most appropriate way to satisfy the needs of the majority of our customers.

Currently, this feature is pending for analysis and is in the queue. Once we complete the analysis, we will then be able to provide you an estimate.

You reported this issue in free support forum and it will be treated with normal priority. To speed up the progress of issue’s resolution, we suggest you please check our paid support policies from following link.
Paid Support Policies


#7

@miniseb31

Please use ChartAxis.Scaling.Minimum and ChartAxis.Scaling.Maximum properties to achieve your requirement. Please check the following code example.

Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);

// Insert chart.
Shape shape = builder.InsertChart(ChartType.Line, 432, 252);
Chart chart = shape.Chart;

// Clear demo data.
chart.Series.Clear();

// Fill data.
chart.Series.Add("Aspose Test Series",
    new[]
    {
        new DateTime(2017, 11, 06), new DateTime(2017, 11, 09), new DateTime(2017, 11, 15),
        new DateTime(2017, 11, 21), new DateTime(2017, 11, 25), new DateTime(2017, 11, 29)
    },
    new[] { 1.2, 0.3, 2.1, 2.9, 4.2, 5.3 });

ChartAxis xAxis = chart.AxisX;
ChartAxis yAxis = chart.AxisY;

// Set X axis bounds.
xAxis.Scaling.Minimum = new AxisBound(new DateTime(2017, 11, 05).ToOADate());
xAxis.Scaling.Maximum = new AxisBound(new DateTime(2017, 12, 03));

// Set major units to a week and minor units to a day.
xAxis.BaseTimeUnit = AxisTimeUnit.Days;
xAxis.MajorUnit = 7;
xAxis.MinorUnit = 1;
xAxis.MajorTickMark = AxisTickMark.Cross;
xAxis.MinorTickMark = AxisTickMark.Outside;

// Define Y axis properties.
yAxis.TickLabelPosition = AxisTickLabelPosition.High;
yAxis.MajorUnit = 100;
yAxis.MinorUnit = 50;
yAxis.DisplayUnit.Unit = AxisBuiltInUnit.Hundreds;
yAxis.Scaling.Minimum = new AxisBound(100);
yAxis.Scaling.Maximum = new AxisBound(700);

doc.Save(ArtifactsDir + "Charts.ChartAxisProperties.docx");

#8

thanks for the information but i want to do generate the chart with linq reporting. then i want to open the document and search for the plot to modify its minimimum and maximum (according to our application settings). the sample code you provide is when we want to insert a plot from scratch by code. (i would like to take advantage of the linq reporting power)


#9

@miniseb31

Thanks for sharing the detail. We have updated the issue detail according to your requirement. We will inform you via this forum thread once there is an update available on this feature.


#10

Sorry i found the way to get the chart from an existing document but i have a problem

If I use doc.GetChildNodes(NodeType.Shape, true); or a ShapeVisitor, Why cant i get the data points. serie.DataPoints.Count is always zero.
Please see my reproduction console applicationTestGrapheAspose.zip (24.3 KB)


#11

@miniseb31

We have tested the scenario and have managed to reproduce the same issue at our side. For the sake of correction, we have logged this problem in our issue tracking system as WORDSNET-18874. You will be notified via this forum thread once this issue is resolved. We apologize for your inconvenience.

Regarding WORDSNET-18571, you can generate the chart using LINQ Reporting and update the minimum and maximum value of axis of chart using Scaling.Minimum and Scaling.Maximum properties.


#12

yes i agree we can close WORDSNET-18571 and open WORDSNET-18874


#13

@minisebdev

We have closed the issue WORDSNET-18571. Please let us know if you have any more queries.