AddLineChart: LineColor limited to Black, or GrayXX%
C++ library for creating XLSX files for MS Excel 2007 and above.
Brought to you by:
oxod,
programmeralex
I cannot find a way to change the Line Color to other than Black or Gray(s)
Get an error: terminating with uncaught exception of type std::out_of_range: map::at: key not found.
Why is this, or am I missing some simple setup?
OK, got it: but it was a bit of a struggle/guess to sort is out...
Is there a User Guide to all of this subtle stuff: I would like to change the X and Y Range and Fonts, where do I go, please...
// Initialise the Color Library for the Trend Chart.
XLSXColorLib cl_lib, gs10_lib;
make_excell_like_named_colors( cl_lib );
make_excell_like_named_colors(gs10_lib); // Changed: was make_grayscale10( gs10_lib );
// Add the TrendData as a Line Chart to the WorkBook.
AddLineChart( book, sheet, cl_lib, gs10_lib );
// Save Excel Workbook...
Hi, there is no user guide, only examples.
Apropos, you dont need to duplicate color library. One is enough. If you need grayscale, just to forget about gs10_lib.
Hi, unfortunately, there is not enough time to prepare a User Guide. Excuse me.
Please see the examples of using the library in the archive with the source code. If you have any questions, feel free to ask.
Alexandr,
It took me a few hours to figure out (learn) what was going on in the Scatter Chart.
You have created excellent examples, as a guide, as you said...
To make things clearer for me, I grouped the code for each Series Line, once I had done that it all became much easier to understand.
I have attached a pdf documenting Scientific.cpp AddScatterChart, code, with my added comments, and grouping, of the code by Line/Marker, to make it easier for a newby to understand the subtlety of the design.
If you get the time, you might want to incorporate this grouping, and comments into your Master File.
Once again, thank you for your help. I will dig in some more to see if I can find out how to change the fonts and format, and range of the X and Y Axis, and the Chart.Robert.
Last edit: Robert McInnes 2022-12-02
Hi Robert,
Example "Scientific.cpp " it was created in order to show what possibilities there are for creating diagrams. I think you are right and I need to rework this example as you suggested. Thank you for your patience and the work done.
Work with fonts and format can be found in "Simple.cpp ".
The range of axes can be set using functions like CChart::SetXAxisMin and CChart::SetXAxisMax, CChart::SetYAxisMin and CChart::SetYAxisMax.