Bar Chart in Dot net - (Very urgent)

Hi

Below are my list of doubts : Pls help me

1.) how to draw the bar columns between two points.

2.) how to add hyperlink text in a sheet and it should navigate to the another sheet.
(I attached the excel sheet for your reference.(Navigation.xls))

Hi,


Thank you for using Aspose.Cells.

For hyperlinks to some other sheet, you can use the following line of code, where B3 cell of current worksheet is hyperlinked to B9 of Sheet2:

worksheet.Hyperlinks.Add(“B3”, 1, 1, “Sheet2!B9”);

You can refer to HYPERLINKS documentation here for additional help as well.

Regarding your query to Bar Chart, please elaborate it. You can have a look at Bar chart Demos
HERE. Let us know if we can be of additional help to you.

thanks for your quick response.

i saw the below link.



based on the above link my requirement is to draw the bar between two points (France && Germany).



Hi,


Can you please explain with the help of a screenshot what do you mean by “Bar”? Are you talking about Bar Graphs? Please make such a graph using MS Excel and share with us so that we have a better idea of what you want to achieve. We appreciate your cooperation in this regard.
rhqm63:
Hi

Below are my list of doubts : Pls help me

1.) how to draw the bar columns between two points.

2.) how to add hyperlink text in a sheet and it should navigate to the another sheet.
(I attached the excel sheet for your reference.(Navigation.xls))
Hi,

1) For hyperlink, please see the following code and its output. I have also attached the screenshot, when you will click on the cell A1, you will navigate to cell B3 in second worksheet.

Please download and use the latest version: Aspose.Cells for .NET v7.2.1.9

I have attached the output file.

C#
//Create a workbook
Workbook workbook = new Workbook();

//Access the first worksheet
Worksheet worksheet = workbook.Worksheets[0];

//Add second worksheet
workbook.Worksheets.Add("Sheet2");

Cell a1 = worksheet.Cells["A1"];

a1.PutValue("Navigate to second worksheet cell B3");

//Add a hyperlink
worksheet.Hyperlinks.Add("A1", 1, 1, "Sheet2!B3");

workbook.Save("output.xlsx");

Screenshot:
rhqm63:
thanks for your quick response.

i saw the below link.



based on the above link my requirement is to draw the bar between two points (France && Germany).



Hi,

Please provide us your expected output xlsx file, you can create your Bar chart manually using Ms-Excel.

We will look into your bar chart and provide you a sample code.

    <br>i don't know to create output in Ms excel.So i have attached my required output in an image.<br><br>Pls help me.<br>

Hi,

Thanks for your posting and screenshot.

We have looked into your issue and it is not directly possible to create such a chart, as a workaround, you will have to use shapes (rectangles) to replace the tick labels of the axis.

Please see the attached xls file. I have also shown the screenshot below.

Screenshot:

please guide me to replace the tick labels of the axis.

Hi,

We think simple chart could support this feature. So please insert shape to replace the tick labels of category axis.

Please try the following code. I have also attached the source and output file for your reference.

C#


string filePath = @“F:\Shak-Data-RW\Downloads\ClusteredColumn.xls”;


Workbook wb = new Workbook(filePath);


Chart chart = wb.Worksheets[0].Charts[0];


chart.Calculate();


chart.PlotArea.X = chart.PlotArea.X;


chart.PlotArea.Y = chart.PlotArea.Y;


chart.PlotArea.Width = chart.PlotArea.Width;


chart.PlotArea.Height = chart.PlotArea.Height;


chart.CategoryAxis.TickLabelPosition = TickLabelPositionType.None;


int count = chart.NSeries[0].CountOfDataValues;


string[] countries = {“France”, “Germany”, “England” };


for (int i = 0; i < count; i++)

{


Aspose.Cells.Drawing.TextBox textBox = chart.Shapes.AddTextBoxInChart(chart.PlotArea.InnerY + chart.PlotArea.InnerHeight, (int)(chart.PlotArea.InnerX + chart.PlotArea.InnerWidth * i * 1.0 / count - 150), 400, 400);


textBox.Text = countries[i];


textBox.LineFormat.IsVisible = false;


textBox.FillFormat.IsVisible = false;


}


wb.Save(filePath + “.out.xls”);