Line type chart linewidth doesn't seem applied in the chart

Hi,


I create a line type chart in the excel and set the line width of one series to 0.75pt, save the excel workbook. When I open the excel , the line width doesn’t look correctly.

I have attached the excel workbook created using Aspose. You can see the blue series line width is set as 0.75pt in the series property, but in the chart, it doesn’t look like 0.75pt (although the line width looks right on the legend).

Please let me know if the question is not clear.

Thanks,
Wei

Hi Wei,

Thanks for your posting and using Aspose.Cells.

We were able to observe this issue. The blue color series line width has been set to 0.75pt but it does not look like this. Please download and try the latest version: Aspose.Cells
for .NET v8.3.0.1
and see if it resolves your issue.

If your issue still persists, then please provide us your runnable sample code replicating this issue. We will look into it and help you asap.

Hi Shakeel,


I have tried the lastest build, the problem still existing. I discovered the problem only occurs if the DashType property is set up (no matter what value), then the linewidth always be 2.25pt, if the DashType not set up, it seems everything works fine. You can run the following code to observe the result.

Dim wb As Workbook = New Workbook
Dim ws As Worksheet = wb.Worksheets(0)
ws.Cells(2, 1).Value = “Gold”
ws.Cells(3, 1).Value = “Silver”
ws.Cells(4, 1).Value = “Bronze”


ws.Cells(1, 2).Value = “USA”
ws.Cells(1, 3).Value = “CHINA”
ws.Cells(1, 4).Value = “RUSSIA”
ws.Cells(1, 5).Value = “AUSTRILIA”
ws.Cells(1, 6).Value = “KOREA”

ws.Cells(2, 2).Value = 35
ws.Cells(2, 3).Value = 32
ws.Cells(2, 4).Value = 27
ws.Cells(2, 5).Value = 17
ws.Cells(2, 6).Value = 16


ws.Cells(3, 2).Value = 39
ws.Cells(3, 3).Value = 17
ws.Cells(3, 4).Value = 27
ws.Cells(3, 5).Value = 16
ws.Cells(3, 6).Value = 9

ws.Cells(4, 2).Value = 29
ws.Cells(4, 3).Value = 14
ws.Cells(4, 4).Value = 28
ws.Cells(4, 5).Value = 16
ws.Cells(4, 6).Value = 12

'Adding a chart to the worksheet
Dim chartIndex As Integer = ws.Charts.Add(Aspose.Cells.Charts.ChartType.Line, 5, 0, 12, 7)
'Accessing the instance of the newly added chart
Dim chart As Aspose.Cells.Charts.Chart = ws.Charts(chartIndex)
chart.Placement = Drawing.PlacementType.MoveAndSize

Dim index1 As Integer = chart.NSeries.Add(“C3:G3”, False)
Dim index2 As Integer = chart.NSeries.Add(“C4:G4”, False)
Dim index3 As Integer = chart.NSeries.Add(“C5:G5”, False)

chart.NSeries(index1).Name = “=B3”
chart.NSeries(index2).Name = “=B4”
chart.NSeries(index3).Name = “=B5”

chart.NSeries(index1).Border.DashType = MsoLineDashStyle.Solid
chart.NSeries(index1).Border.WeightPt = 0.75
chart.NSeries(index2).Border.DashType = MsoLineDashStyle.DashDot
chart.NSeries(index2).Border.WeightPt = 0.75
chart.NSeries(index3).Border.WeightPt = 0.75

Dim img As Image = chart.ToImage()

wb.Save(“C:\ChartLine.xlsx”)

Please let me know if you have any question.

Thanks,
Wei

Hi Wei,

Thanks for your sample code and using Aspose.Cells.

We were able to observe this issue after executing your sample code with the latest version.

We have logged this issue in our database for investigation. We will look into it and fix this issue. Once, the issue is resolved or we have some other update for you, we will let you know asap.

This issue has been logged as

  • CELLSNET-43189 - Line width is not getting applied to the chart

I have also attached the output Excel file generated with your code for a reference.

Hi,

Thanks for your using Aspose.Cells.

Please download and try the latest fix: Aspose.Cells for .NET v8.3.0.4 and let us know your feedback.

The issues you have found earlier (filed as CELLSNET-43189) have been fixed in this update.


This message was posted using Notification2Forum from Downloads module by Aspose Notifier.