libxlsxwriter/include/xlsxwriter/chart.h in fast_excel-0.2.6 vs libxlsxwriter/include/xlsxwriter/chart.h in fast_excel-0.3.0

- old
+ new

@@ -1,9 +1,9 @@ /* * libxlsxwriter * - * Copyright 2014-2018, John McNamara, jmcnamara@cpan.org. See LICENSE.txt. + * Copyright 2014-2019, John McNamara, jmcnamara@cpan.org. See LICENSE.txt. * * chart - A libxlsxwriter library for creating Excel XLSX chart files. * */ @@ -170,15 +170,21 @@ LXW_CHART_LEGEND_TOP, /** Chart legend positioned at bottom. */ LXW_CHART_LEGEND_BOTTOM, + /** Chart legend positioned at top right. */ + LXW_CHART_LEGEND_TOP_RIGHT, + /** Chart legend overlaid at right side. */ LXW_CHART_LEGEND_OVERLAY_RIGHT, /** Chart legend overlaid at left side. */ - LXW_CHART_LEGEND_OVERLAY_LEFT + LXW_CHART_LEGEND_OVERLAY_LEFT, + + /** Chart legend overlaid at top right. */ + LXW_CHART_LEGEND_OVERLAY_TOP_RIGHT } lxw_chart_legend_position; /** * @brief Chart line dash types. * @@ -522,10 +528,24 @@ /** Turn off the the axis labels. */ LXW_CHART_AXIS_LABEL_POSITION_NONE } lxw_chart_axis_label_position; /** + * @brief Axis label alignments. + */ +typedef enum lxw_chart_axis_label_alignment { + /** Chart axis label alignment: center. */ + LXW_CHART_AXIS_LABEL_ALIGN_CENTER, + + /** Chart axis label alignment: left. */ + LXW_CHART_AXIS_LABEL_ALIGN_LEFT, + + /** Chart axis label alignment: right. */ + LXW_CHART_AXIS_LABEL_ALIGN_RIGHT +} lxw_chart_axis_label_alignment; + +/** * @brief Display units for chart value axis. */ typedef enum lxw_chart_axis_display_unit { /** Axis display units: None. The default. */ @@ -979,10 +999,11 @@ uint8_t is_date; uint8_t is_value; uint8_t axis_position; uint8_t position_axis; uint8_t label_position; + uint8_t label_align; uint8_t hidden; uint8_t reverse; uint8_t has_min; double min; @@ -1046,10 +1067,11 @@ uint32_t axis_id_4; uint8_t in_use; uint8_t chart_group; uint8_t cat_has_num_fmt; + uint8_t is_chartsheet; uint8_t has_horiz_cat_axis; uint8_t has_horiz_val_axis; uint8_t style_id; @@ -1101,10 +1123,11 @@ lxw_chart_line *down_bar_line; lxw_chart_fill *up_bar_fill; lxw_chart_fill *down_bar_fill; uint8_t default_label_position; + uint8_t is_protected; STAILQ_ENTRY (lxw_chart) ordered_list_pointers; STAILQ_ENTRY (lxw_chart) list_pointers; } lxw_chart; @@ -1282,11 +1305,11 @@ * a cell in the workbook that contains the name: * * @code * lxw_chart_series *series = chart_add_series(chart, NULL, "=Sheet1!$B$2:$B$7"); * - * chart_series_set_name(series, "=Sheet1!$B1$1"); + * chart_series_set_name(series, "=Sheet1!$B$1"); * @endcode * * See also the `chart_series_set_name_range()` function to see how to set the * name formula programmatically. */ @@ -2273,11 +2296,11 @@ * * The name parameter can also be a formula such as `=Sheet1!$A$1` to point to * a cell in the workbook that contains the name: * * @code - * chart_axis_set_name(chart->x_axis, "=Sheet1!$B1$1"); + * chart_axis_set_name(chart->x_axis, "=Sheet1!$B$1"); * @endcode * * See also the `chart_axis_set_name_range()` function to see how to set the * name formula programmatically. * @@ -2565,11 +2588,11 @@ * * For example: * * @code * chart_axis_set_label_position(chart->x_axis, LXW_CHART_AXIS_LABEL_POSITION_HIGH); - chart_axis_set_label_position(chart->y_axis, LXW_CHART_AXIS_LABEL_POSITION_HIGH); + * chart_axis_set_label_position(chart->y_axis, LXW_CHART_AXIS_LABEL_POSITION_HIGH); * @endcode * * @image html chart_label_position2.png * * The allowable values: @@ -2589,10 +2612,35 @@ * See @ref ww_charts_axes. */ void chart_axis_set_label_position(lxw_chart_axis *axis, uint8_t position); /** + * @brief Set the alignment of the axis labels. + * + * @param axis A pointer to a chart #lxw_chart_axis object. + * @param align A #lxw_chart_axis_label_alignment value. + * + * Position the category axis labels for the chart. The labels are the + * numbers, or strings or dates, on the axis that indicate the categories + * of the axis. + * + * The allowable values: + * + * - #LXW_CHART_AXIS_LABEL_ALIGN_CENTER - Align label center (default). + * - #LXW_CHART_AXIS_LABEL_ALIGN_LEFT - Align label left. + * - #LXW_CHART_AXIS_LABEL_ALIGN_RIGHT - Align label right. + * + * @code + * chart_axis_set_label_align(chart->x_axis, LXW_CHART_AXIS_LABEL_ALIGN_RIGHT); + * @endcode + * + * **Axis types**: This function is applicable to category axes only. + * See @ref ww_charts_axes. + */ +void chart_axis_set_label_align(lxw_chart_axis *axis, uint8_t align); + +/** * @brief Set the minimum value for a chart axis. * * @param axis A pointer to a chart #lxw_chart_axis object. * @param min Minimum value for chart axis. Value axes only. * @@ -2956,11 +3004,11 @@ * * The name parameter can also be a formula such as `=Sheet1!$A$1` to point to * a cell in the workbook that contains the name: * * @code - * chart_title_set_name(chart, "=Sheet1!$B1$1"); + * chart_title_set_name(chart, "=Sheet1!$B$1"); * @endcode * * See also the `chart_title_set_name_range()` function to see how to set the * name formula programmatically. * @@ -3038,11 +3086,13 @@ * LXW_CHART_LEGEND_NONE * LXW_CHART_LEGEND_RIGHT * LXW_CHART_LEGEND_LEFT * LXW_CHART_LEGEND_TOP * LXW_CHART_LEGEND_BOTTOM + * LXW_CHART_LEGEND_TOP_RIGHT * LXW_CHART_LEGEND_OVERLAY_RIGHT * LXW_CHART_LEGEND_OVERLAY_LEFT + * LXW_CHART_LEGEND_OVERLAY_TOP_RIGHT * * For example: * * @code * chart_legend_set_position(chart, LXW_CHART_LEGEND_BOTTOM);