How to Set custom color in column chart bars

I am writing to you regarding a license version issue I am experiencing with your product. My license key for Aspose Word version is 20.5.0. But after updating version 20.5.0 to 21.6.0 which does not seem to be working properly, and I am unable to use the product as intended.
Here series.Format.Fill.ForeColor is not supported under this version
I have double-checked the license key and confirmed that it is the correct one for the version of Aspose Word that I am using. However, when I try to use certain features of the product, I am prompted with a runtime error message like

System.AggregateException: One or more errors occurred. (The type initializer for '​ ' threw an exception.)
 ---> System.TypeInitializationException: The type initializer for '​ ' threw an exception.
 ---> System.TypeInitializationException: The type initializer for 'SkiaSharp.SKImageInfo' threw an exception.
 ---> System.DllNotFoundException: Unable to load shared library 'libSkiaSharp' or one of its dependencies. In order to help diagnose loading problems, consider setting the LD_DEBUG environment variable: liblibSkiaSharp: cannot open shared object file: No such file or directory
   at SkiaSharp.SkiaApi.sk_colortype_get_default_8888()
   at SkiaSharp.SKImageInfo..cctor()
   --- End of inner exception stack trace ---
   at SkiaSharp.SKBitmap..ctor(Int32 width, Int32 height, Boolean isOpaque)
   at ​ ..cctor()
   --- End of inner exception stack trace ---
   at ​ ..ctor(Int32 , Int32 , Single , Single ,     )
   at    . ()
   at    . (Stream )
   at    .(   , SizeF , Stream , ImageSaveOptions , IWarningCallback ,    )
   at Aspose.Words.Rendering.NodeRendererBase.Save(Stream stream, ImageSaveOptions saveOptions)
   at  ​ . (ShapeRenderer ,     )
   at  ​ . (ShapeBase ,     )
   at  ​ .(ShapeBase ,     , Boolean )
   at  ​ .(ShapeBase ,     , Boolean )
   at ​  .​     (ShapeBase )
   at  ​ . (ShapeBase ,     )
   at  ​ . (Shape ,     )
   at  ​ .VisitShapeStart(Shape )
   at Aspose.Words.Drawing.Shape.r3ka8zscesabkstb24kjjv9sml9wq7pw    (DocumentVisitor )
   at Aspose.Words.CompositeNode.AcceptCore(DocumentVisitor visitor)
   at Aspose.Words.Drawing.Shape.Accept(DocumentVisitor visitor)
   at Aspose.Words.CompositeNode.AcceptChildren(DocumentVisitor visitor)
   at Aspose.Words.CompositeNode.AcceptCore(DocumentVisitor visitor)
   at Aspose.Words.Paragraph.Accept(DocumentVisitor visitor)
   at Aspose.Words.CompositeNode.AcceptChildren(DocumentVisitor visitor)
   at Aspose.Words.CompositeNode.AcceptCore(DocumentVisitor visitor)
   at Aspose.Words.Tables.Cell.Accept(DocumentVisitor visitor)
   at Aspose.Words.CompositeNode.AcceptChildren(DocumentVisitor visitor)
   at Aspose.Words.CompositeNode.AcceptCore(DocumentVisitor visitor)
   at Aspose.Words.Tables.Row.Accept(DocumentVisitor visitor)
   at Aspose.Words.CompositeNode.AcceptChildren(DocumentVisitor visitor)
   at Aspose.Words.CompositeNode.AcceptCore(DocumentVisitor visitor)
   at Aspose.Words.Tables.Table.Accept(DocumentVisitor visitor)
   at Aspose.Words.CompositeNode.AcceptChildren(DocumentVisitor visitor)
   at Aspose.Words.CompositeNode.AcceptCore(DocumentVisitor visitor)
   at Aspose.Words.Body.Accept(DocumentVisitor visitor)
   at Aspose.Words.CompositeNode.AcceptChildren(DocumentVisitor visitor)
   at Aspose.Words.CompositeNode.AcceptCore(DocumentVisitor visitor)
   at Aspose.Words.Section.Accept(DocumentVisitor visitor)
   at Aspose.Words.CompositeNode.AcceptChildren(DocumentVisitor visitor)
   at Aspose.Words.CompositeNode.AcceptCore(DocumentVisitor visitor)
   at Aspose.Words.Document.Accept(DocumentVisitor visitor)
   at  ​ . (    )
   at Aspose.Words.Document.​(Stream , String , SaveOptions )
   at Aspose.Words.Document.Save(Stream stream, SaveOptions saveOptions)
   at Aspose.Words.Document.Save(Stream stream, SaveFormat saveFormat)
   at Markers.Api.Assessment.Logic.AssessmentReportCardICSE.Impl.AssessmentReportCardICSEService.<>c__DisplayClass21_1.<GenerateReportCardFile>b__0(JToken student) in /src/Markers.Api.Assessment/Markers.Api.Assessment/Logic/AssessmentReportCardICSEService/Impl/AssessmentReportCardICSEService.cs:line 291
   at System.Threading.Tasks.Parallel.<>c__DisplayClass33_0`2.<ForEachWorker>b__0(Int32 i)
   at System.Threading.Tasks.Parallel.<>c__DisplayClass19_0`1.<ForWorker>b__1(RangeWorker& currentWorker, Int32 timeout, Boolean& replicationDelegateYieldedBeforeCompletion)
--- End of stack trace from previous location ---
   at System.Threading.Tasks.Parallel.<>c__DisplayClass19_0`1.<ForWorker>b__1(RangeWorker& currentWorker, Int32 timeout, Boolean& replicationDelegateYieldedBeforeCompletion)
   at System.Threading.Tasks.TaskReplicator.Replica`1.ExecuteAction(Boolean& yieldedBeforeCompletion)
   at System.Threading.Tasks.TaskReplicator.Replica.Execute()
   --- End of inner exception stack trace ---
   at System.Threading.Tasks.TaskReplicator.Run[TState](ReplicatableUserAction`1 action, ParallelOptions options, Boolean stopOnFirstFailure)
   at System.Threading.Tasks.Parallel.ForWorker[TLocal](Int32 fromInclusive, Int32 toExclusive, ParallelOptions parallelOptions, Action`1 body, Action`2 bodyWithState, Func`4 bodyWithLocal, Func`1 localInit, Action`1 localFinally)
--- End of stack trace from previous location ---
   at System.Threading.Tasks.Parallel.ThrowSingleCancellationExceptionOrOtherException(ICollection exceptions, CancellationToken cancelToken, Exception otherException)
   at System.Threading.Tasks.Parallel.ForWorker[TLocal](Int32 fromInclusive, Int32 toExclusive, ParallelOptions parallelOptions, Action`1 body, Action`2 bodyWithState, Func`4 bodyWithLocal, Func`1 localInit, Action`1 localFinally)
   at System.Threading.Tasks.Parallel.ForEachWorker[TSource,TLocal](IList`1 list, ParallelOptions parallelOptions, Action`1 body, Action`2 bodyWithState, Action`3 bodyWithStateAndIndex, Func`4 bodyWithStateAndLocal, Func`5 bodyWithEverything, Func`1 localInit, Action`1 localFinally)
   at System.Threading.Tasks.Parallel.ForEachWorker[TSource,TLocal](IEnumerable`1 source, ParallelOptions parallelOptions, Action`1 body, Action`2 bodyWithState, Action`3 bodyWithStateAndIndex, Func`4 bodyWithStateAndLocal, Func`5 bodyWithEverything, Func`1 localInit, Action`1 localFinally)
   at System.Threading.Tasks.Parallel.ForEach[TSource](IEnumerable`1 source, Action`1 body)
   at Markers.Api.Assessment.Logic.AssessmentReportCardICSE.Impl.AssessmentReportCardICSEService.GenerateReportCardFile(String jsonData, List`1 dataSections, Int64 customerId, String markingPeriodTitle, Int64 schoolId, Int64 MarkingPeriod, Int64 GradeLevelId, String studentids, Int64 sectionid, Int64 schoolsessionid, ReportCardFormatAssociationModel reportCardFormatAssociationModel) in /src/Markers.Api.Assessment/Markers.Api.Assessment/Logic/AssessmentReportCardICSEService/Impl/AssessmentReportCardICSEService.cs:line 108
   at Markers.Api.Assessment.Logic.AssessmentReportCardICSE.Impl.AssessmentReportCardICSEService.GenerateReportCard(ReportCardOutputDataViewModel reportCardOutputDataViewModel, IList`1 reportCardTemplateData, Int64 CurrentCustomerId) in /src/Markers.Api.Assessment/Markers.Api.Assessment/Logic/AssessmentReportCardICSEService/Impl/AssessmentReportCardICSEService.cs:line 377
   at Markers.Api.Assessment.Logic.AssessmentReportCard.Impl.AssessmentReportCardService.GenerateReportCard(ReportCardOutputDataViewModel reportCardOutputDataViewModel, IList`1 reportCardTemplateData, Int64 CurrentCustomerId) in /src/Markers.Api.Assessment/Markers.Api.Assessment/Logic/AssessmentReportCard/Impl/AssessmentReportCardService.cs:line 72
   at Markers.Api.Assessment.Controllers.AssessmentReportCardController.GenerateReportCard(ReportCardOutputDataViewModel reportCardOutputDataViewModel) in /src/Markers.Api.Assessment/Markers.Api.Assessment/Controllers/AssessmentReportCardController.cs:line 110'.

I would greatly appreciate it if you could investigate this issue and provide a resolution as soon as possible. I rely heavily on Aspose Word for my work, and this issue is causing significant disruptions to my productivity.

If there is any additional information that you need from me to resolve this issue, please do not hesitate to let me know. I am happy to provide any necessary details to help expedite the resolution of this issue.

Thank you for your prompt attention to this matter.

@wefivesoft Most likely your application is deployed to Linux server and uses .NET Standard or .NET6 version of Aspose.Words.
Aspose.Words for .NET Standard and .NET6 uses SkiaSharp to deal with graphics, to make it work on Linux you have to add reference either to SkiaSharp.NativeAssets.Linux or to SkiaSharp.NativeAssets.Linux.NoDependencies

If you add reference to SkiaSharp.NativeAssets.Linux, you should also install libfontconfig1 in your system. SkiaSharp.NativeAssets.Linux depends on this library. You can use the following command to install it:

apt-get update && apt-get install -y libfontconfig1

If you do not have rights to install packages, or other reasons not to install libfontconfig1, you can simply use SkiaSharp.NativeAssets.Linux.NoDependencies, which does not require installation of libfontconfig1.

I would recommend to use SkiaSharp.NativeAssets.Linux 2.80.3 version.

Hi @alexey.noskov
Sorry for late reply. It’s works after install “libfontconfig1” in linux server as you suggested.
Thanks a lot.

1 Like

Hi @alexey.noskov,
How to change chart series X and Y axis label color. I want to make it bold the both the axis. Screen shot attached.
We are using OS Windows 10, .Net Core 5.0, Aspose.PDF 21.4.0, Aspose.Words 21.6.0

Sample code:

ChartSeries series = chart.Series.Add(“Highest Marks”, _reportcardchart.ListOfHightestMarks.Select(e => e.SubjectTitle).ToArray(), _reportcardchart.ListOfHightestMarks.Select(e => e.points).ToArray());
if (reportCardFormatAssociationModel.ParameterDetails.BarColor.Mode.ToLower() != “auto”)
series.Format.Fill.ForeColor = CC.FromHtml(reportCardFormatAssociationModel.ParameterDetails.BarColor.Colors.Split(’,’)[0]);

Thanks
Chandan

@wefivesoft Unfortunately, currently there is no public API to specify axis labels font.
We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.

Issue ID(s): WORDSNET-25803

You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.

A post was split to a new topic: What is the cost of paid support services?

The issues you have found earlier (filed as WORDSNET-25803) have been fixed in this Aspose.Words for .NET 24.3 update also available on NuGet.