- Update example code in the documentation
- Update unit tests
- Rename `PictureOptions` to `GraphicOptions`
- Adjust partial options fields data types for the `PictureOptions` and `Shape` structure
- Update dependencies module
// Name: Set the name for the series. The name is displayed in the chart legend and in the formula bar. The 'Name' property is optional and if it isn't supplied it will default to Series 1..n. The name can also be a formula such as Sheet1!$A$1
// Name: Set the name for the series. The name is displayed in the chart legend
// and in the formula bar. The 'Name' property is optional and if it isn't
// supplied it will default to Series 1..n. The name can also be a formula such
// as Sheet1!$A$1
//
// Categories: This sets the chart category labels. The category is more or less the same as the X axis. In most chart types the 'Categories' property is optional and the chart will just assume a sequential series from 1..n.
// Categories: This sets the chart category labels. The category is more or less
// the same as the X axis. In most chart types the 'Categories' property is
// optional and the chart will just assume a sequential series from 1..n.
//
// Values: This is the most important property of a series and is the only mandatory option for every chart object. This option links the chart with the worksheet data that it displays.
// Values: This is the most important property of a series and is the only
// mandatory option for every chart object. This option links the chart with
// the worksheet data that it displays.
//
// Line: This sets the line format of the line chart. The 'Line' property is optional and if it isn't supplied it will default style. The options that can be set are width and color. The range of width is 0.25pt - 999pt. If the value of width is outside the range, the default width of the line is 2pt. The value for color should be represented in hex format (e.g., #000000 - #FFFFFF)
// Line: This sets the line format of the line chart. The 'Line' property is
// optional and if it isn't supplied it will default style. The options that
// can be set are width and color. The range of width is 0.25pt - 999pt. If the
// value of width is outside the range, the default width of the line is 2pt.
// The value for color should be represented in hex format
// (e.g., #000000 - #FFFFFF)
//
// Marker: This sets the marker of the line chart and scatter chart. The range of optional field 'size' is 2-72 (default value is 5). The enumeration value of optional field 'Symbol' are (default value is 'auto'):
// Marker: This sets the marker of the line chart and scatter chart. The range
// of optional field 'Size' is 2-72 (default value is 5). The enumeration value
// of optional field 'Symbol' are (default value is 'auto'):
// Set properties of the chart legend. The options that can be set are:
//
// None
// Position
// ShowLegendKey
//
// None: Specified if show the legend without overlapping the chart. The default value is 'false'.
//
// Position: Set the position of the chart legend. The default legend position is right. This parameter only takes effect when 'none' is false. The available positions are:
// Position: Set the position of the chart legend. The default legend position
// is bottom. The available positions are:
//
// none
// top
// bottom
// left
// right
// top_right
//
// ShowLegendKey: Set the legend keys shall be shown in data labels. The default value is false.
// ShowLegendKey: Set the legend keys shall be shown in data labels. The default
// value is false.
//
// Set properties of the chart title. The properties that can be set are:
//
// Title
//
// Name: Set the name (title) for the chart. The name is displayed above the chart. The name can also be a formula such as Sheet1!$A$1 or a list with a sheet name. The name property is optional. The default is to have no chart title.
// Name: Set the name (title) for the chart. The name is displayed above the
// chart. The name can also be a formula such as Sheet1!$A$1 or a list with a
// sheet name. The name property is optional. The default is to have no chart
// title.
//
// Specifies how blank cells are plotted on the chart by ShowBlanksAs. The default value is gap. The options that can be set are:
// Specifies how blank cells are plotted on the chart by 'ShowBlanksAs'. The
// default value is gap. The options that can be set are:
// MajorUnit: Specifies the distance between major ticks. Shall contain a positive floating-point number. The MajorUnit property is optional. The default value is auto.
// MajorUnit: Specifies the distance between major ticks. Shall contain a
// positive floating-point number. The MajorUnit property is optional. The
// default value is auto.
//
// TickLabelSkip: Specifies how many tick labels to skip between label that is drawn. The TickLabelSkip property is optional. The default value is auto.
// TickLabelSkip: Specifies how many tick labels to skip between label that is
// drawn. The 'TickLabelSkip' property is optional. The default value is auto.
//
// ReverseOrder: Specifies that the categories or values on reverse order (orientation of the chart). The ReverseOrder property is optional. The default value is false.
// ReverseOrder: Specifies that the categories or values on reverse order
// (orientation of the chart). The ReverseOrder property is optional. The
// default value is false.
//
// Maximum: Specifies that the fixed maximum, 0 is auto. The Maximum property is optional. The default value is auto.
// Maximum: Specifies that the fixed maximum, 0 is auto. The 'Maximum' property
// is optional. The default value is auto.
//
// Minimum: Specifies that the fixed minimum, 0 is auto. The Minimum property is optional. The default value is auto.
// Minimum: Specifies that the fixed minimum, 0 is auto. The 'Minimum' property
// is optional. The default value is auto.
//
// Font: Specifies that the font of the horizontal and vertical axis. The properties of font that can be set are:
// Font: Specifies that the font of the horizontal and vertical axis. The
assert.EqualError(t,f.addDrawingChart("Sheet1",path,"A1",0,0,0,&PictureOptions{PrintObject:boolPtr(true),Locked:boolPtr(false),XScale:float64Ptr(defaultPictureScale),YScale:float64Ptr(defaultPictureScale)}),"XML syntax error on line 1: invalid UTF-8")
assert.EqualError(t,f.addDrawingChart("Sheet1",path,"A1",0,0,0,&GraphicOptions{PrintObject:boolPtr(true),Locked:boolPtr(false)}),"XML syntax error on line 1: invalid UTF-8")
}
funcTestAddSheetDrawingChart(t*testing.T){
f:=NewFile()
path:="xl/drawings/drawing1.xml"
f.Pkg.Store(path,MacintoshCyrillicCharset)
assert.EqualError(t,f.addSheetDrawingChart(path,0,&PictureOptions{PrintObject:boolPtr(true),Locked:boolPtr(false),XScale:float64Ptr(defaultPictureScale),YScale:float64Ptr(defaultPictureScale)}),"XML syntax error on line 1: invalid UTF-8")
assert.EqualError(t,f.addSheetDrawingChart(path,0,&GraphicOptions{PrintObject:boolPtr(true),Locked:boolPtr(false)}),"XML syntax error on line 1: invalid UTF-8")
{sheetName:"Sheet2",cell:"P1",opts:&Chart{Type:"line3D",Series:series2,Format:format,Legend:ChartLegend{Position:&positionTop,ShowLegendKey:false},Title:ChartTitle{Name:"3D Line Chart"},PlotArea:plotArea,ShowBlanksAs:"zero",XAxis:ChartAxis{MajorGridLines:true,MinorGridLines:true,TickLabelSkip:1},YAxis:ChartAxis{MajorGridLines:true,MinorGridLines:true,MajorUnit:1}}},
{sheetName:"Sheet2",cell:"P1",opts:&Chart{Type:"line3D",Series:series2,Format:format,Legend:ChartLegend{Position:"top",ShowLegendKey:false},Title:ChartTitle{Name:"3D Line Chart"},PlotArea:plotArea,ShowBlanksAs:"zero",XAxis:ChartAxis{MajorGridLines:true,MinorGridLines:true,TickLabelSkip:1},YAxis:ChartAxis{MajorGridLines:true,MinorGridLines:true,MajorUnit:1}}},
{sheetName:"Sheet2",cell:"P48",opts:&Chart{Type:"bar",Series:series,Format:format,Legend:legend,Title:ChartTitle{Name:"2D Clustered Bar Chart"},PlotArea:plotArea,ShowBlanksAs:"zero"}},
{sheetName:"Sheet2",cell:"X48",opts:&Chart{Type:"barStacked",Series:series,Format:format,Legend:legend,Title:ChartTitle{Name:"2D Stacked Bar Chart"},PlotArea:plotArea,ShowBlanksAs:"zero"}},
{cell:"C1",opts:&Chart{Type:"line",Dimension:ChartDimension{Width:&dimension[0],Height:&dimension[1]},Series:series,Title:ChartTitle{Name:"Line chart without log scaling"}}},
{cell:"M1",opts:&Chart{Type:"line",Dimension:ChartDimension{Width:&dimension[0],Height:&dimension[1]},Series:series,Title:ChartTitle{Name:"Line chart with log 10.5 scaling"},YAxis:ChartAxis{LogBase:10.5}}},
{cell:"A25",opts:&Chart{Type:"line",Dimension:ChartDimension{Width:&dimension[2],Height:&dimension[3]},Series:series,Title:ChartTitle{Name:"Line chart with log 1.9 scaling"},YAxis:ChartAxis{LogBase:1.9}}},
{cell:"F25",opts:&Chart{Type:"line",Dimension:ChartDimension{Width:&dimension[2],Height:&dimension[3]},Series:series,Title:ChartTitle{Name:"Line chart with log 2 scaling"},YAxis:ChartAxis{LogBase:2}}},
{cell:"K25",opts:&Chart{Type:"line",Dimension:ChartDimension{Width:&dimension[2],Height:&dimension[3]},Series:series,Title:ChartTitle{Name:"Line chart with log 1000.1 scaling"},YAxis:ChartAxis{LogBase:1000.1}}},
{cell:"P25",opts:&Chart{Type:"line",Dimension:ChartDimension{Width:&dimension[2],Height:&dimension[3]},Series:series,Title:ChartTitle{Name:"Line chart with log 1000 scaling"},YAxis:ChartAxis{LogBase:1000}}},
{cell:"C1",opts:&Chart{Type:"line",Dimension:ChartDimension{Width:dimension[0],Height:dimension[1]},Series:series,Title:ChartTitle{Name:"Line chart without log scaling"}}},
{cell:"M1",opts:&Chart{Type:"line",Dimension:ChartDimension{Width:dimension[0],Height:dimension[1]},Series:series,Title:ChartTitle{Name:"Line chart with log 10.5 scaling"},YAxis:ChartAxis{LogBase:10.5}}},
{cell:"A25",opts:&Chart{Type:"line",Dimension:ChartDimension{Width:dimension[2],Height:dimension[3]},Series:series,Title:ChartTitle{Name:"Line chart with log 1.9 scaling"},YAxis:ChartAxis{LogBase:1.9}}},
{cell:"F25",opts:&Chart{Type:"line",Dimension:ChartDimension{Width:dimension[2],Height:dimension[3]},Series:series,Title:ChartTitle{Name:"Line chart with log 2 scaling"},YAxis:ChartAxis{LogBase:2}}},
{cell:"K25",opts:&Chart{Type:"line",Dimension:ChartDimension{Width:dimension[2],Height:dimension[3]},Series:series,Title:ChartTitle{Name:"Line chart with log 1000.1 scaling"},YAxis:ChartAxis{LogBase:1000.1}}},
{cell:"P25",opts:&Chart{Type:"line",Dimension:ChartDimension{Width:dimension[2],Height:dimension[3]},Series:series,Title:ChartTitle{Name:"Line chart with log 1000 scaling"},YAxis:ChartAxis{LogBase:1000}}},
}{
// Add two chart, one without and one with log scaling