I have been trying to set the border on a
ChartShape object, but although the colour seems right, it appears very faded. I have attached a picture of the output next to our application, which shows the desired border colours and another of the code that colours this border. Can you please tell me how to make the border on a chart fully visible, so that the colours match our source colours?
Please note that the
(Border).Transparency property is already set to 0, so that is not causing this issue.
Images.zip (118.6 KB)
Thanks for the template file and screenshot.
Please try our latest version/fix: Aspose.Cells for .NET v19.2.5 (attached)
Aspose.Cells19.2.5 For .Net2_AuthenticodeSigned.Zip (4.8 MB)
Aspose.Cells19.2.5 For .Net4.0.Zip (4.8 MB)
If you still find the issue with v19.2.5, kindly provide us a sample project (runnable) to show the issue, we will check it soon. Also, try to make the border visible (IsVisible attribute) explicitly in your code if it helps a bit.
I think that you have misunderstood my request. I am not reporting a bug. As you can see from the screenshot, the correct colours are being output on the other shapes. In fact, it seems as though the correct colours are being output even to the charts. The problem is that the opacity or transparency of the border seems to be set somewhere. I am merely asking you which properties can affect this, so that I can output the colours with the correct opacity.
I tested with this code and the colours can be set ok and at the correct 0 transparency:
Workbook workbook = new Workbook(@"C:\Users\sheridan.yuen\Downloads\Test.xlsx");
ChartShape chart = workbook.Worksheets.Shapes as ChartShape;
chart.Chart.ChartArea.Border.WeightPx = 2;
chart.Chart.ChartArea.Border.Color = Color.FromArgb(0, 0, 0, 255);
Therefore, something is making the border in my initial example semi transparent, but it is NOT the
Transparency property. What else can have this affect?
On closer inspection, I don’t think the colours are semi transparent, as I cannot see the background behind them through it at all. Somehow, the colours are wrong in another way.
Did you try using latest version/fix (the links are shared in our previous reply) ?
If you still find the issue with v19.2.5, I am afraid, we need a demo example to reproduce the issue on our end. So, please provide us a sample project (runnable) to show the issue (as requested earlier), we will check it soon.
IsVisible property is set to true already.
I cannot update to the latest version now.
I am simply asking you which properties can affect the border on a chart. Please provide a list of properties OUTSIDE the
Line class that can affect its colour and/opactiy.
chart.Chart.ChartArea.Border.Color property clearly works in our current version, as I tested it in the code sample that I provided above, but something is affecting it and I don’t know what. I just need to know what other properties may affect its output colour.
chartShape.Chart.PlotArea.Border.WeightPx = 2;
chartShape.Chart.PlotArea.Border.Color = insertedColor;
chartShape.Chart.ChartArea.Border.WeightPx = 2;
chartShape.Chart.ChartArea.Border.Color = insertedColor;
chartShape.Chart.ChartArea.Area.ForegroundColor = modifiedColor;
Using the code above, I can set the plot area border and the chart area background to the correct colours, but something is interfering with the chart area border colours.
Capture.PNG (1.6 KB)
Thanks for the screenshot and further details
Well, Chart.ChartArea.Border.Color should work seamlessly and there is not any significant attributes or objects which could affect its color or opacity. Anyways, we will still evaluate it further and discuss the matter internally. We will get back to you soon with more details.
As requested earlier, it would be best if you could separate the issue and provide us a sample project (runnable) to reproduce the issue on our end. This will help us really to evaluate your issue precisely to consequently figure it out soon. Moreover, to test your scenario using latest fix (if it works or not), you may try it in a separate or duplicated project (if appropriate).
I understand that a project which reproduces this problem would be preferred, but as you can see above, I tried and failed to produce that. In a simple project, this problem does not occur.
However, there is still a definite problem here. I have verified that the correct colours are being output, and those same colours appear accurately on all of the other
Shape objects. I have also experimented with the
Transparency property and can confirm that this is not causing this issue. The incorrectly output border colours appear to be semi-transparent because of their colour, but on closer inspection, nothing can be seen through them , so they are not actually semi-opaque. Something is making them appear lighter than they should.
Sorry to press you but I would still insist on you try the latest fix/version: Aspose.Cells for .NET v19.2.5 in your duplicated project (a copy to your original project) if it works or not. The reason is we recently fixed an issue regarding shapes borders (where the color we were applying rendered as a bit darker or lighter).
Anyways, could you spare us little time as we need to discuss the issue internally (based on your given artifacts) before we log it as I still feel you won’t give us your simulated project for reproducing it.
Hopefully we will get back to you with more details with a couple of days.
Your 19.2.5 version is NOT available via the nuget package manager. However, I made a copy of our solution and manually updated all of the Aspose.Cells assemblies to your latest version, accessed from above and the result is the same.
Yes, we only publish official releases on Nuget repos., the fixes are not uploaded there.
Could you provide your sample project, at least we could evaluate/ investigate your issue and log a ticket for it.
It’s simply not possible for us to provide you with our source code. It is a massive application with many commercial secrets in the code base.
I look forward to hearing the results of your investigations.
We did evaluate your issue a bit but could not find any issue. The issue might be in your code in your big project, so you should debug your code thoroughly and try to trace the issue. We are very sorry without a simulation project or code, we cannot figure it out. Anyways, we will further check and in case we have something to share, we will update you.
I have already debugged our solution. I have found that the
Line object that displays the incorrect colours has EXACTLY the same values for its properties as one that works correctly, so the problem must lie outside the
You have tried to reproduce this issue separately but could not succeed and same is the result here. Now this is next to impossible for us to create same scenario as it is there in your huge project and then observe the issue. We need to reproduce this issue here for providing any further assistance as based upon the available information it is not possible to proceed anymore. I am afraid that in this situation only you can assist us to reproduce this problem. Please take some time and simplify your project by removing all the unnecessary code which is not required for reproducing this scenario. Also remove your proprietary code and replace the secret logics with some simple dummy values etc. We hope that after putting some effort you may come up with a simplified runnable code (without any missing reference) for our analysis.
We are really very sorry for any inconvenience caused to you.