Aspose.Word Chart

How to show X and Y axis lable lines only using aspose.word.charts c#

Fore reference written in image

please help with sample code

Appreciate you urgent reply :slight_smile:

Waiting for your reply

Issue in production

@Aspose Team please help on this, we have a pressure from Client

@nitish.bandle @Amol_Hekade You can use ChartAxis class to configure appearance of axis on the chart. Please see code examples in our documentation.

Thanks Alexey.

But I think my problem solution is not in the given code snippet.

Re Attaching screen shots

I wrote my comment in screen shot what I required, This is present in MS chart. Previously we are using MSChart and our client want same as previous one.

Plz provide solution asap, so we can fix and continue with production deployment.

@Amol_Hekade @nitish.bandle Please see the following simple code that demonstrates how to configure axis lines:

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

Shape shape = builder.InsertChart(ChartType.Line, 500, 300);
Chart chart = shape.Chart;

// Clear the chart's demo data series to start with a clean chart.
chart.Series.Clear();

// Insert a chart series with categories for the X-axis and respective numeric values for the Y-axis.
chart.Series.Add("Aspose Test Series",
    new[] { "Word", "PDF", "Excel", "GoogleDocs", "Note" },
    new double[] { 640, 320, 280, 120, 150 });

// Chart axes have various options that can change their appearance,
// such as their direction, major/minor unit ticks, and tick marks.
ChartAxis xAxis = chart.AxisX;
xAxis.HasMajorGridlines = false;
xAxis.Format.Stroke.Color = Color.Black;

ChartAxis yAxis = chart.AxisY;
yAxis.HasMajorGridlines = false;
yAxis.Format.Stroke.Color = Color.Black;

doc.Save(@"C:\Temp\out.docx");

out.docx (8.5 KB)

Thank You so much for quick support.