    {-# LANGUAGE CPP #-}
    {-# LANGUAGE OverloadedStrings #-}
    {-# LANGUAGE RecordWildCards #-}
    {-# LANGUAGE TemplateHaskell #-}
    {-# LANGUAGE DeriveGeneric #-}
    module Codec.Xlsx.Types.Drawing.Chart where

    import GHC.Generics (Generic)

    #ifdef USE_MICROLENS
    import Lens.Micro.TH (makeLenses)
    #else
    import Control.Lens.TH
    #endif
    import Control.DeepSeq (NFData)
    import Data.Default
    import Data.Maybe (catMaybes, listToMaybe, maybeToList)
    import Data.Text (Text)
    import Text.XML
    import Text.XML.Cursor

    import Codec.Xlsx.Parser.Internal
    import Codec.Xlsx.Types.Common
    import Codec.Xlsx.Types.Drawing.Common
    import Codec.Xlsx.Writer.Internal

    -- | Main Chart holder, combines
    -- TODO: title, autoTitleDeleted, pivotFmts
    --  view3D, floor, sideWall, backWall, showDLblsOverMax, extLst
    data ChartSpace = ChartSpace
      { ChartSpace -> Maybe ChartTitle
    _chspTitle :: Maybe ChartTitle
      , ChartSpace -> [Chart]
    _chspCharts :: [Chart]
      , ChartSpace -> Maybe Legend
    _chspLegend :: Maybe Legend
      , ChartSpace -> Maybe Bool
    _chspPlotVisOnly :: Maybe Bool
      , ChartSpace -> Maybe DispBlanksAs
    _chspDispBlanksAs :: Maybe DispBlanksAs
      } deriving (ChartSpace -> ChartSpace -> Bool
    (ChartSpace -> ChartSpace -> Bool)
    -> (ChartSpace -> ChartSpace -> Bool) -> Eq ChartSpace
    forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
    $c== :: ChartSpace -> ChartSpace -> Bool
    == :: ChartSpace -> ChartSpace -> Bool
    $c/= :: ChartSpace -> ChartSpace -> Bool
    /= :: ChartSpace -> ChartSpace -> Bool
    Eq, Int -> ChartSpace -> ShowS
    [ChartSpace] -> ShowS
    ChartSpace -> String
    (Int -> ChartSpace -> ShowS)
    -> (ChartSpace -> String)
    -> ([ChartSpace] -> ShowS)
    -> Show ChartSpace
    forall a.
    (Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
    $cshowsPrec :: Int -> ChartSpace -> ShowS
    showsPrec :: Int -> ChartSpace -> ShowS
    $cshow :: ChartSpace -> String
    show :: ChartSpace -> String
    $cshowList :: [ChartSpace] -> ShowS
    showList :: [ChartSpace] -> ShowS
    Show, (forall x. ChartSpace -> Rep ChartSpace x)
    -> (forall x. Rep ChartSpace x -> ChartSpace) -> Generic ChartSpace
    forall x. Rep ChartSpace x -> ChartSpace
    forall x. ChartSpace -> Rep ChartSpace x
    forall a.
    (forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
    $cfrom :: forall x. ChartSpace -> Rep ChartSpace x
    from :: forall x. ChartSpace -> Rep ChartSpace x
    $cto :: forall x. Rep ChartSpace x -> ChartSpace
    to :: forall x. Rep ChartSpace x -> ChartSpace
    Generic)
    instance NFData ChartSpace

    -- | Chart title
    --
    -- TODO: layout, overlay, spPr, txPr, extLst
    newtype ChartTitle =
      ChartTitle (Maybe TextBody)
      deriving (ChartTitle -> ChartTitle -> Bool
    (ChartTitle -> ChartTitle -> Bool)
    -> (ChartTitle -> ChartTitle -> Bool) -> Eq ChartTitle
    forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
    $c== :: ChartTitle -> ChartTitle -> Bool
    == :: ChartTitle -> ChartTitle -> Bool
    $c/= :: ChartTitle -> ChartTitle -> Bool
    /= :: ChartTitle -> ChartTitle -> Bool
    Eq, Int -> ChartTitle -> ShowS
    [ChartTitle] -> ShowS
    ChartTitle -> String
    (Int -> ChartTitle -> ShowS)
    -> (ChartTitle -> String)
    -> ([ChartTitle] -> ShowS)
    -> Show ChartTitle
    forall a.
    (Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
    $cshowsPrec :: Int -> ChartTitle -> ShowS
    showsPrec :: Int -> ChartTitle -> ShowS
    $cshow :: ChartTitle -> String
    show :: ChartTitle -> String
    $cshowList :: [ChartTitle] -> ShowS
    showList :: [ChartTitle] -> ShowS
    Show, (forall x. ChartTitle -> Rep ChartTitle x)
    -> (forall x. Rep ChartTitle x -> ChartTitle) -> Generic ChartTitle
    forall x. Rep ChartTitle x -> ChartTitle
    forall x. ChartTitle -> Rep ChartTitle x
    forall a.
    (forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
    $cfrom :: forall x. ChartTitle -> Rep ChartTitle x
    from :: forall x. ChartTitle -> Rep ChartTitle x
    $cto :: forall x. Rep ChartTitle x -> ChartTitle
    to :: forall x. Rep ChartTitle x -> ChartTitle
    Generic)
    instance NFData ChartTitle

    -- | This simple type specifies the possible ways to display blanks.
    --
    -- See 21.2.3.10 "ST_DispBlanksAs (Display Blanks As)" (p. 3444)
    data DispBlanksAs
      = DispBlanksAsGap
        -- ^ Specifies that blank values shall be left as a gap.
      | DispBlanksAsSpan
        -- ^ Specifies that blank values shall be spanned with a line.
      | DispBlanksAsZero
        -- ^ Specifies that blank values shall be treated as zero.
      deriving (DispBlanksAs -> DispBlanksAs -> Bool
    (DispBlanksAs -> DispBlanksAs -> Bool)
    -> (DispBlanksAs -> DispBlanksAs -> Bool) -> Eq DispBlanksAs
    forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
    $c== :: DispBlanksAs -> DispBlanksAs -> Bool
    == :: DispBlanksAs -> DispBlanksAs -> Bool
    $c/= :: DispBlanksAs -> DispBlanksAs -> Bool
    /= :: DispBlanksAs -> DispBlanksAs -> Bool
    Eq, Int -> DispBlanksAs -> ShowS
    [DispBlanksAs] -> ShowS
    DispBlanksAs -> String
    (Int -> DispBlanksAs -> ShowS)
    -> (DispBlanksAs -> String)
    -> ([DispBlanksAs] -> ShowS)
    -> Show DispBlanksAs
    forall a.
    (Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
    $cshowsPrec :: Int -> DispBlanksAs -> ShowS
    showsPrec :: Int -> DispBlanksAs -> ShowS
    $cshow :: DispBlanksAs -> String
    show :: DispBlanksAs -> String
    $cshowList :: [DispBlanksAs] -> ShowS
    showList :: [DispBlanksAs] -> ShowS
    Show, (forall x. DispBlanksAs -> Rep DispBlanksAs x)
    -> (forall x. Rep DispBlanksAs x -> DispBlanksAs)
    -> Generic DispBlanksAs
    forall x. Rep DispBlanksAs x -> DispBlanksAs
    forall x. DispBlanksAs -> Rep DispBlanksAs x
    forall a.
    (forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
    $cfrom :: forall x. DispBlanksAs -> Rep DispBlanksAs x
    from :: forall x. DispBlanksAs -> Rep DispBlanksAs x
    $cto :: forall x. Rep DispBlanksAs x -> DispBlanksAs
    to :: forall x. Rep DispBlanksAs x -> DispBlanksAs
    Generic)
    instance NFData DispBlanksAs

    -- TODO: legendEntry, layout, overlay, spPr, txPr, extLst
    data Legend = Legend
        { Legend -> Maybe LegendPos
    _legendPos     :: Maybe LegendPos
        , Legend -> Maybe Bool
    _legendOverlay :: Maybe Bool
        } deriving (Legend -> Legend -> Bool
    (Legend -> Legend -> Bool)
    -> (Legend -> Legend -> Bool) -> Eq Legend
    forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
    $c== :: Legend -> Legend -> Bool
    == :: Legend -> Legend -> Bool
    $c/= :: Legend -> Legend -> Bool
    /= :: Legend -> Legend -> Bool
    Eq, Int -> Legend -> ShowS
    [Legend] -> ShowS
    Legend -> String
    (Int -> Legend -> ShowS)
    -> (Legend -> String) -> ([Legend] -> ShowS) -> Show Legend
    forall a.
    (Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
    $cshowsPrec :: Int -> Legend -> ShowS
    showsPrec :: Int -> Legend -> ShowS
    $cshow :: Legend -> String
    show :: Legend -> String
    $cshowList :: [Legend] -> ShowS
    showList :: [Legend] -> ShowS
    Show, (forall x. Legend -> Rep Legend x)
    -> (forall x. Rep Legend x -> Legend) -> Generic Legend
    forall x. Rep Legend x -> Legend
    forall x. Legend -> Rep Legend x
    forall a.
    (forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
    $cfrom :: forall x. Legend -> Rep Legend x
    from :: forall x. Legend -> Rep Legend x
    $cto :: forall x. Rep Legend x -> Legend
    to :: forall x. Rep Legend x -> Legend
    Generic)
    instance NFData Legend

    -- See 21.2.3.24 "ST_LegendPos (Legend Position)" (p. 3449)
    data LegendPos
      = LegendBottom
        -- ^ b (Bottom) Specifies that the legend shall be drawn at the
        -- bottom of the chart.
      | LegendLeft
        -- ^ l (Left) Specifies that the legend shall be drawn at the left
        -- of the chart.
      | LegendRight
        -- ^ r (Right) Specifies that the legend shall be drawn at the
        -- right of the chart.
      | LegendTop
        -- ^ t (Top) Specifies that the legend shall be drawn at the top
        -- of the chart.
      | LegendTopRight
        -- ^ tr (Top Right) Specifies that the legend shall be drawn at
        -- the top right of the chart.
      deriving (LegendPos -> LegendPos -> Bool
    (LegendPos -> LegendPos -> Bool)
    -> (LegendPos -> LegendPos -> Bool) -> Eq LegendPos
    forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
    $c== :: LegendPos -> LegendPos -> Bool
    == :: LegendPos -> LegendPos -> Bool
    $c/= :: LegendPos -> LegendPos -> Bool
    /= :: LegendPos -> LegendPos -> Bool
    Eq, Int -> LegendPos -> ShowS
    [LegendPos] -> ShowS
    LegendPos -> String
    (Int -> LegendPos -> ShowS)
    -> (LegendPos -> String)
    -> ([LegendPos] -> ShowS)
    -> Show LegendPos
    forall a.
    (Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
    $cshowsPrec :: Int -> LegendPos -> ShowS
    showsPrec :: Int -> LegendPos -> ShowS
    $cshow :: LegendPos -> String
    show :: LegendPos -> String
    $cshowList :: [LegendPos] -> ShowS
    showList :: [LegendPos] -> ShowS
    Show, (forall x. LegendPos -> Rep LegendPos x)
    -> (forall x. Rep LegendPos x -> LegendPos) -> Generic LegendPos
    forall x. Rep LegendPos x -> LegendPos
    forall x. LegendPos -> Rep LegendPos x
    forall a.
    (forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
    $cfrom :: forall x. LegendPos -> Rep LegendPos x
    from :: forall x. LegendPos -> Rep LegendPos x
    $cto :: forall x. Rep LegendPos x -> LegendPos
    to :: forall x. Rep LegendPos x -> LegendPos
    Generic)
    instance NFData LegendPos

    -- | Specific Chart
    -- TODO:
    --   area3DChart, line3DChart, stockChart, radarChart,
    --   pie3DChart, doughnutChart, bar3DChart, ofPieChart,
    --   surfaceChart, surface3DChart, bubbleChart
    data Chart
      = LineChart { Chart -> ChartGrouping
    _lnchGrouping :: ChartGrouping
                  , Chart -> [LineSeries]
    _lnchSeries :: [LineSeries]
                  , Chart -> Maybe Bool
    _lnchMarker :: Maybe Bool
                    -- ^ specifies that the marker shall be shown
                  , Chart -> Maybe Bool
    _lnchSmooth :: Maybe Bool
                    -- ^ specifies the line connecting the points on the chart shall be
                    -- smoothed using Catmull-Rom splines
                  }
      | AreaChart { Chart -> Maybe ChartGrouping
    _archGrouping :: Maybe ChartGrouping
                  , Chart -> [AreaSeries]
    _archSeries :: [AreaSeries]
                  }
      | BarChart { Chart -> BarDirection
    _brchDirection :: BarDirection
                 , Chart -> Maybe BarChartGrouping
    _brchGrouping :: Maybe BarChartGrouping
                 , Chart -> [BarSeries]
    _brchSeries :: [BarSeries]
                 }
      | PieChart { Chart -> [PieSeries]
    _pichSeries :: [PieSeries]
                 }
      | ScatterChart { Chart -> ScatterStyle
    _scchStyle :: ScatterStyle
                     , Chart -> [ScatterSeries]
    _scchSeries :: [ScatterSeries]
                     }
      deriving (Chart -> Chart -> Bool
    (Chart -> Chart -> Bool) -> (Chart -> Chart -> Bool) -> Eq Chart
    forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
    $c== :: Chart -> Chart -> Bool
    == :: Chart -> Chart -> Bool
    $c/= :: Chart -> Chart -> Bool
    /= :: Chart -> Chart -> Bool
    Eq, Int -> Chart -> ShowS
    [Chart] -> ShowS
    Chart -> String
    (Int -> Chart -> ShowS)
    -> (Chart -> String) -> ([Chart] -> ShowS) -> Show Chart
    forall a.
    (Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
    $cshowsPrec :: Int -> Chart -> ShowS
    showsPrec :: Int -> Chart -> ShowS
    $cshow :: Chart -> String
    show :: Chart -> String
    $cshowList :: [Chart] -> ShowS
    showList :: [Chart] -> ShowS
    Show, (forall x. Chart -> Rep Chart x)
    -> (forall x. Rep Chart x -> Chart) -> Generic Chart
    forall x. Rep Chart x -> Chart
    forall x. Chart -> Rep Chart x
    forall a.
    (forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
    $cfrom :: forall x. Chart -> Rep Chart x
    from :: forall x. Chart -> Rep Chart x
    $cto :: forall x. Rep Chart x -> Chart
    to :: forall x. Rep Chart x -> Chart
    Generic)
    instance NFData Chart

    -- | Possible groupings for a chart
    --
    -- See 21.2.3.17 "ST_Grouping (Grouping)" (p. 3446)
    data ChartGrouping
      = PercentStackedGrouping
        -- ^ (100% Stacked) Specifies that the chart series are drawn next to each
        -- other along the value axis and scaled to total 100%.
      | StackedGrouping
        -- ^ (Stacked) Specifies that the chart series are drawn next to each
        -- other on the value axis.
      | StandardGrouping
        -- ^(Standard) Specifies that the chart series are drawn on the value
        -- axis.
      deriving (ChartGrouping -> ChartGrouping -> Bool
    (ChartGrouping -> ChartGrouping -> Bool)
    -> (ChartGrouping -> ChartGrouping -> Bool) -> Eq ChartGrouping
    forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
    $c== :: ChartGrouping -> ChartGrouping -> Bool
    == :: ChartGrouping -> ChartGrouping -> Bool
    $c/= :: ChartGrouping -> ChartGrouping -> Bool
    /= :: ChartGrouping -> ChartGrouping -> Bool
    Eq, Int -> ChartGrouping -> ShowS
    [ChartGrouping] -> ShowS
    ChartGrouping -> String
    (Int -> ChartGrouping -> ShowS)
    -> (ChartGrouping -> String)
    -> ([ChartGrouping] -> ShowS)
    -> Show ChartGrouping
    forall a.
    (Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
    $cshowsPrec :: Int -> ChartGrouping -> ShowS
    showsPrec :: Int -> ChartGrouping -> ShowS
    $cshow :: ChartGrouping -> String
    show :: ChartGrouping -> String
    $cshowList :: [ChartGrouping] -> ShowS
    showList :: [ChartGrouping] -> ShowS
    Show, (forall x. ChartGrouping -> Rep ChartGrouping x)
    -> (forall x. Rep ChartGrouping x -> ChartGrouping)
    -> Generic ChartGrouping
    forall x. Rep ChartGrouping x -> ChartGrouping
    forall x. ChartGrouping -> Rep ChartGrouping x
    forall a.
    (forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
    $cfrom :: forall x. ChartGrouping -> Rep ChartGrouping x
    from :: forall x. ChartGrouping -> Rep ChartGrouping x
    $cto :: forall x. Rep ChartGrouping x -> ChartGrouping
    to :: forall x. Rep ChartGrouping x -> ChartGrouping
    Generic)
    instance NFData ChartGrouping

    -- | Possible groupings for a bar chart
    --
    -- See 21.2.3.4 "ST_BarGrouping (Bar Grouping)" (p. 3441)
    data BarChartGrouping
      = BarClusteredGrouping
        -- ^ Specifies that the chart series are drawn next to each other
        -- along the category axis.
      | BarPercentStackedGrouping
        -- ^ (100% Stacked) Specifies that the chart series are drawn next to each
        -- other along the value axis and scaled to total 100%.
      | BarStackedGrouping
        -- ^ (Stacked) Specifies that the chart series are drawn next to each
        -- other on the value axis.
      | BarStandardGrouping
        -- ^(Standard) Specifies that the chart series are drawn on the value
        -- axis.
      deriving (BarChartGrouping -> BarChartGrouping -> Bool
    (BarChartGrouping -> BarChartGrouping -> Bool)
    -> (BarChartGrouping -> BarChartGrouping -> Bool)
    -> Eq BarChartGrouping
    forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
    $c== :: BarChartGrouping -> BarChartGrouping -> Bool
    == :: BarChartGrouping -> BarChartGrouping -> Bool
    $c/= :: BarChartGrouping -> BarChartGrouping -> Bool
    /= :: BarChartGrouping -> BarChartGrouping -> Bool
    Eq, Int -> BarChartGrouping -> ShowS
    [BarChartGrouping] -> ShowS
    BarChartGrouping -> String
    (Int -> BarChartGrouping -> ShowS)
    -> (BarChartGrouping -> String)
    -> ([BarChartGrouping] -> ShowS)
    -> Show BarChartGrouping
    forall a.
    (Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
    $cshowsPrec :: Int -> BarChartGrouping -> ShowS
    showsPrec :: Int -> BarChartGrouping -> ShowS
    $cshow :: BarChartGrouping -> String
    show :: BarChartGrouping -> String
    $cshowList :: [BarChartGrouping] -> ShowS
    showList :: [BarChartGrouping] -> ShowS
    Show, (forall x. BarChartGrouping -> Rep BarChartGrouping x)
    -> (forall x. Rep BarChartGrouping x -> BarChartGrouping)
    -> Generic BarChartGrouping
    forall x. Rep BarChartGrouping x -> BarChartGrouping
    forall x. BarChartGrouping -> Rep BarChartGrouping x
    forall a.
    (forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
    $cfrom :: forall x. BarChartGrouping -> Rep BarChartGrouping x
    from :: forall x. BarChartGrouping -> Rep BarChartGrouping x
    $cto :: forall x. Rep BarChartGrouping x -> BarChartGrouping
    to :: forall x. Rep BarChartGrouping x -> BarChartGrouping
    Generic)
    instance NFData BarChartGrouping

    -- | Possible directions for a bar chart
    --
    -- See 21.2.3.3 "ST_BarDir (Bar Direction)" (p. 3441)
    data BarDirection
      = DirectionBar
      | DirectionColumn
      deriving (BarDirection -> BarDirection -> Bool
    (BarDirection -> BarDirection -> Bool)
    -> (BarDirection -> BarDirection -> Bool) -> Eq BarDirection
    forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
    $c== :: BarDirection -> BarDirection -> Bool
    == :: BarDirection -> BarDirection -> Bool
    $c/= :: BarDirection -> BarDirection -> Bool
    /= :: BarDirection -> BarDirection -> Bool
    Eq, Int -> BarDirection -> ShowS
    [BarDirection] -> ShowS
    BarDirection -> String
    (Int -> BarDirection -> ShowS)
    -> (BarDirection -> String)
    -> ([BarDirection] -> ShowS)
    -> Show BarDirection
    forall a.
    (Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
    $cshowsPrec :: Int -> BarDirection -> ShowS
    showsPrec :: Int -> BarDirection -> ShowS
    $cshow :: BarDirection -> String
    show :: BarDirection -> String
    $cshowList :: [BarDirection] -> ShowS
    showList :: [BarDirection] -> ShowS
    Show, (forall x. BarDirection -> Rep BarDirection x)
    -> (forall x. Rep BarDirection x -> BarDirection)
    -> Generic BarDirection
    forall x. Rep BarDirection x -> BarDirection
    forall x. BarDirection -> Rep BarDirection x
    forall a.
    (forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
    $cfrom :: forall x. BarDirection -> Rep BarDirection x
    from :: forall x. BarDirection -> Rep BarDirection x
    $cto :: forall x. Rep BarDirection x -> BarDirection
    to :: forall x. Rep BarDirection x -> BarDirection
    Generic)
    instance NFData BarDirection

    -- | Possible styles of scatter chart
    --
    -- /Note:/ It appears that even for 'ScatterMarker' style Exel draws a
    -- line between chart points if otline fill for '_scserShared' isn't
    -- set to so it's not quite clear how could Excel use this property
    --
    -- See 21.2.3.40 "ST_ScatterStyle (Scatter Style)" (p. 3455)
    data ScatterStyle
      = ScatterNone
      | ScatterLine
      | ScatterLineMarker
      | ScatterMarker
      | ScatterSmooth
      | ScatterSmoothMarker
      deriving (ScatterStyle -> ScatterStyle -> Bool
    (ScatterStyle -> ScatterStyle -> Bool)
    -> (ScatterStyle -> ScatterStyle -> Bool) -> Eq ScatterStyle
    forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
    $c== :: ScatterStyle -> ScatterStyle -> Bool
    == :: ScatterStyle -> ScatterStyle -> Bool
    $c/= :: ScatterStyle -> ScatterStyle -> Bool
    /= :: ScatterStyle -> ScatterStyle -> Bool
    Eq, Int -> ScatterStyle -> ShowS
    [ScatterStyle] -> ShowS
    ScatterStyle -> String
    (Int -> ScatterStyle -> ShowS)
    -> (ScatterStyle -> String)
    -> ([ScatterStyle] -> ShowS)
    -> Show ScatterStyle
    forall a.
    (Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
    $cshowsPrec :: Int -> ScatterStyle -> ShowS
    showsPrec :: Int -> ScatterStyle -> ShowS
    $cshow :: ScatterStyle -> String
    show :: ScatterStyle -> String
    $cshowList :: [ScatterStyle] -> ShowS
    showList :: [ScatterStyle] -> ShowS
    Show, (forall x. ScatterStyle -> Rep ScatterStyle x)
    -> (forall x. Rep ScatterStyle x -> ScatterStyle)
    -> Generic ScatterStyle
    forall x. Rep ScatterStyle x -> ScatterStyle
    forall x. ScatterStyle -> Rep ScatterStyle x
    forall a.
    (forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
    $cfrom :: forall x. ScatterStyle -> Rep ScatterStyle x
    from :: forall x. ScatterStyle -> Rep ScatterStyle x
    $cto :: forall x. Rep ScatterStyle x -> ScatterStyle
    to :: forall x. Rep ScatterStyle x -> ScatterStyle
    Generic)
    instance NFData ScatterStyle

    -- | Single data point options
    --
    -- TODO:  invertIfNegative,  bubble3D, explosion, pictureOptions, extLst
    --
    -- See 21.2.2.52 "dPt (Data Point)" (p. 3384)
    data DataPoint = DataPoint
      { DataPoint -> Maybe DataMarker
    _dpMarker :: Maybe DataMarker
      , DataPoint -> Maybe ShapeProperties
    _dpShapeProperties :: Maybe ShapeProperties
      } deriving (DataPoint -> DataPoint -> Bool
    (DataPoint -> DataPoint -> Bool)
    -> (DataPoint -> DataPoint -> Bool) -> Eq DataPoint
    forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
    $c== :: DataPoint -> DataPoint -> Bool
    == :: DataPoint -> DataPoint -> Bool
    $c/= :: DataPoint -> DataPoint -> Bool
    /= :: DataPoint -> DataPoint -> Bool
    Eq, Int -> DataPoint -> ShowS
    [DataPoint] -> ShowS
    DataPoint -> String
    (Int -> DataPoint -> ShowS)
    -> (DataPoint -> String)
    -> ([DataPoint] -> ShowS)
    -> Show DataPoint
    forall a.
    (Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
    $cshowsPrec :: Int -> DataPoint -> ShowS
    showsPrec :: Int -> DataPoint -> ShowS
    $cshow :: DataPoint -> String
    show :: DataPoint -> String
    $cshowList :: [DataPoint] -> ShowS
    showList :: [DataPoint] -> ShowS
    Show, (forall x. DataPoint -> Rep DataPoint x)
    -> (forall x. Rep DataPoint x -> DataPoint) -> Generic DataPoint
    forall x. Rep DataPoint x -> DataPoint
    forall x. DataPoint -> Rep DataPoint x
    forall a.
    (forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
    $cfrom :: forall x. DataPoint -> Rep DataPoint x
    from :: forall x. DataPoint -> Rep DataPoint x
    $cto :: forall x. Rep DataPoint x -> DataPoint
    to :: forall x. Rep DataPoint x -> DataPoint
    Generic)
    instance NFData DataPoint

    -- | Specifies common series options
    -- TODO: spPr
    --
    -- See @EG_SerShared@ (p. 4063)
    data Series = Series
      { Series -> Maybe Formula
    _serTx :: Maybe Formula
        -- ^ specifies text for a series name, without rich text formatting
        -- currently only reference formula is supported
      , Series -> Maybe ShapeProperties
    _serShapeProperties :: Maybe ShapeProperties
      } deriving (Series -> Series -> Bool
    (Series -> Series -> Bool)
    -> (Series -> Series -> Bool) -> Eq Series
    forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
    $c== :: Series -> Series -> Bool
    == :: Series -> Series -> Bool
    $c/= :: Series -> Series -> Bool
    /= :: Series -> Series -> Bool
    Eq, Int -> Series -> ShowS
    [Series] -> ShowS
    Series -> String
    (Int -> Series -> ShowS)
    -> (Series -> String) -> ([Series] -> ShowS) -> Show Series
    forall a.
    (Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
    $cshowsPrec :: Int -> Series -> ShowS
    showsPrec :: Int -> Series -> ShowS
    $cshow :: Series -> String
    show :: Series -> String
    $cshowList :: [Series] -> ShowS
    showList :: [Series] -> ShowS
    Show, (forall x. Series -> Rep Series x)
    -> (forall x. Rep Series x -> Series) -> Generic Series
    forall x. Rep Series x -> Series
    forall x. Series -> Rep Series x
    forall a.
    (forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
    $cfrom :: forall x. Series -> Rep Series x
    from :: forall x. Series -> Rep Series x
    $cto :: forall x. Rep Series x -> Series
    to :: forall x. Rep Series x -> Series
    Generic)
    instance NFData Series

    -- | A series on a line chart
    --
    -- TODO: dPt, trendline, errBars, cat, extLst
    --
    -- See @CT_LineSer@ (p. 4064)
    data LineSeries = LineSeries
      { LineSeries -> Series
    _lnserShared :: Series
      , LineSeries -> Maybe DataMarker
    _lnserMarker :: Maybe DataMarker
      , LineSeries -> Maybe DataLblProps
    _lnserDataLblProps :: Maybe DataLblProps
      , LineSeries -> Maybe Formula
    _lnserVal :: Maybe Formula
        -- ^ currently only reference formula is supported
      , LineSeries -> Maybe Bool
    _lnserSmooth :: Maybe Bool
      } deriving (LineSeries -> LineSeries -> Bool
    (LineSeries -> LineSeries -> Bool)
    -> (LineSeries -> LineSeries -> Bool) -> Eq LineSeries
    forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
    $c== :: LineSeries -> LineSeries -> Bool
    == :: LineSeries -> LineSeries -> Bool
    $c/= :: LineSeries -> LineSeries -> Bool
    /= :: LineSeries -> LineSeries -> Bool
    Eq, Int -> LineSeries -> ShowS
    [LineSeries] -> ShowS
    LineSeries -> String
    (Int -> LineSeries -> ShowS)
    -> (LineSeries -> String)
    -> ([LineSeries] -> ShowS)
    -> Show LineSeries
    forall a.
    (Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
    $cshowsPrec :: Int -> LineSeries -> ShowS
    showsPrec :: Int -> LineSeries -> ShowS
    $cshow :: LineSeries -> String
    show :: LineSeries -> String
    $cshowList :: [LineSeries] -> ShowS
    showList :: [LineSeries] -> ShowS
    Show, (forall x. LineSeries -> Rep LineSeries x)
    -> (forall x. Rep LineSeries x -> LineSeries) -> Generic LineSeries
    forall x. Rep LineSeries x -> LineSeries
    forall x. LineSeries -> Rep LineSeries x
    forall a.
    (forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
    $cfrom :: forall x. LineSeries -> Rep LineSeries x
    from :: forall x. LineSeries -> Rep LineSeries x
    $cto :: forall x. Rep LineSeries x -> LineSeries
    to :: forall x. Rep LineSeries x -> LineSeries
    Generic)
    instance NFData LineSeries

    -- | A series on an area chart
    --
    -- TODO: pictureOptions, dPt, trendline, errBars, cat, extLst
    --
    -- See @CT_AreaSer@ (p. 4065)
    data AreaSeries = AreaSeries
      { AreaSeries -> Series
    _arserShared :: Series
      , AreaSeries -> Maybe DataLblProps
    _arserDataLblProps :: Maybe DataLblProps
      , AreaSeries -> Maybe Formula
    _arserVal :: Maybe Formula
      } deriving (AreaSeries -> AreaSeries -> Bool
    (AreaSeries -> AreaSeries -> Bool)
    -> (AreaSeries -> AreaSeries -> Bool) -> Eq AreaSeries
    forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
    $c== :: AreaSeries -> AreaSeries -> Bool
    == :: AreaSeries -> AreaSeries -> Bool
    $c/= :: AreaSeries -> AreaSeries -> Bool
    /= :: AreaSeries -> AreaSeries -> Bool
    Eq, Int -> AreaSeries -> ShowS
    [AreaSeries] -> ShowS
    AreaSeries -> String
    (Int -> AreaSeries -> ShowS)
    -> (AreaSeries -> String)
    -> ([AreaSeries] -> ShowS)
    -> Show AreaSeries
    forall a.
    (Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
    $cshowsPrec :: Int -> AreaSeries -> ShowS
    showsPrec :: Int -> AreaSeries -> ShowS
    $cshow :: AreaSeries -> String
    show :: AreaSeries -> String
    $cshowList :: [AreaSeries] -> ShowS
    showList :: [AreaSeries] -> ShowS
    Show, (forall x. AreaSeries -> Rep AreaSeries x)
    -> (forall x. Rep AreaSeries x -> AreaSeries) -> Generic AreaSeries
    forall x. Rep AreaSeries x -> AreaSeries
    forall x. AreaSeries -> Rep AreaSeries x
    forall a.
    (forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
    $cfrom :: forall x. AreaSeries -> Rep AreaSeries x
    from :: forall x. AreaSeries -> Rep AreaSeries x
    $cto :: forall x. Rep AreaSeries x -> AreaSeries
    to :: forall x. Rep AreaSeries x -> AreaSeries
    Generic)
    instance NFData AreaSeries

    -- | A series on a bar chart
    --
    -- TODO: invertIfNegative, pictureOptions, dPt, trendline, errBars,
    -- cat, shape, extLst
    --
    -- See @CT_BarSer@ (p. 4064)
    data BarSeries = BarSeries
      { BarSeries -> Series
    _brserShared :: Series
      , BarSeries -> Maybe DataLblProps
    _brserDataLblProps :: Maybe DataLblProps
      , BarSeries -> Maybe Formula
    _brserVal :: Maybe Formula
      } deriving (BarSeries -> BarSeries -> Bool
    (BarSeries -> BarSeries -> Bool)
    -> (BarSeries -> BarSeries -> Bool) -> Eq BarSeries
    forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
    $c== :: BarSeries -> BarSeries -> Bool
    == :: BarSeries -> BarSeries -> Bool
    $c/= :: BarSeries -> BarSeries -> Bool
    /= :: BarSeries -> BarSeries -> Bool
    Eq, Int -> BarSeries -> ShowS
    [BarSeries] -> ShowS
    BarSeries -> String
    (Int -> BarSeries -> ShowS)
    -> (BarSeries -> String)
    -> ([BarSeries] -> ShowS)
    -> Show BarSeries
    forall a.
    (Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
    $cshowsPrec :: Int -> BarSeries -> ShowS
    showsPrec :: Int -> BarSeries -> ShowS
    $cshow :: BarSeries -> String
    show :: BarSeries -> String
    $cshowList :: [BarSeries] -> ShowS
    showList :: [BarSeries] -> ShowS
    Show, (forall x. BarSeries -> Rep BarSeries x)
    -> (forall x. Rep BarSeries x -> BarSeries) -> Generic BarSeries
    forall x. Rep BarSeries x -> BarSeries
    forall x. BarSeries -> Rep BarSeries x
    forall a.
    (forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
    $cfrom :: forall x. BarSeries -> Rep BarSeries x
    from :: forall x. BarSeries -> Rep BarSeries x
    $cto :: forall x. Rep BarSeries x -> BarSeries
    to :: forall x. Rep BarSeries x -> BarSeries
    Generic)
    instance NFData BarSeries

    -- | A series on a pie chart
    --
    -- TODO: explosion, cat, extLst
    --
    -- See @CT_PieSer@ (p. 4065)
    data PieSeries = PieSeries
      { PieSeries -> Series
    _piserShared :: Series
      , PieSeries -> [DataPoint]
    _piserDataPoints :: [DataPoint]
      -- ^ normally you should set fill for chart datapoints to make them
      -- properly colored
      , PieSeries -> Maybe DataLblProps
    _piserDataLblProps :: Maybe DataLblProps
      , PieSeries -> Maybe Formula
    _piserVal :: Maybe Formula
      } deriving (PieSeries -> PieSeries -> Bool
    (PieSeries -> PieSeries -> Bool)
    -> (PieSeries -> PieSeries -> Bool) -> Eq PieSeries
    forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
    $c== :: PieSeries -> PieSeries -> Bool
    == :: PieSeries -> PieSeries -> Bool
    $c/= :: PieSeries -> PieSeries -> Bool
    /= :: PieSeries -> PieSeries -> Bool
    Eq, Int -> PieSeries -> ShowS
    [PieSeries] -> ShowS
    PieSeries -> String
    (Int -> PieSeries -> ShowS)
    -> (PieSeries -> String)
    -> ([PieSeries] -> ShowS)
    -> Show PieSeries
    forall a.
    (Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
    $cshowsPrec :: Int -> PieSeries -> ShowS
    showsPrec :: Int -> PieSeries -> ShowS
    $cshow :: PieSeries -> String
    show :: PieSeries -> String
    $cshowList :: [PieSeries] -> ShowS
    showList :: [PieSeries] -> ShowS
    Show, (forall x. PieSeries -> Rep PieSeries x)
    -> (forall x. Rep PieSeries x -> PieSeries) -> Generic PieSeries
    forall x. Rep PieSeries x -> PieSeries
    forall x. PieSeries -> Rep PieSeries x
    forall a.
    (forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
    $cfrom :: forall x. PieSeries -> Rep PieSeries x
    from :: forall x. PieSeries -> Rep PieSeries x
    $cto :: forall x. Rep PieSeries x -> PieSeries
    to :: forall x. Rep PieSeries x -> PieSeries
    Generic)
    instance NFData PieSeries

    -- | A series on a scatter chart
    --
    -- TODO: dPt, trendline, errBars, smooth, extLst
    --
    -- See @CT_ScatterSer@ (p. 4064)
    data ScatterSeries = ScatterSeries
      { ScatterSeries -> Series
    _scserShared :: Series
      , ScatterSeries -> Maybe DataMarker
    _scserMarker :: Maybe DataMarker
      , ScatterSeries -> Maybe DataLblProps
    _scserDataLblProps :: Maybe DataLblProps
      , ScatterSeries -> Maybe Formula
    _scserXVal :: Maybe Formula
      , ScatterSeries -> Maybe Formula
    _scserYVal :: Maybe Formula
      , ScatterSeries -> Maybe Bool
    _scserSmooth :: Maybe Bool
      } deriving (ScatterSeries -> ScatterSeries -> Bool
    (ScatterSeries -> ScatterSeries -> Bool)
    -> (ScatterSeries -> ScatterSeries -> Bool) -> Eq ScatterSeries
    forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
    $c== :: ScatterSeries -> ScatterSeries -> Bool
    == :: ScatterSeries -> ScatterSeries -> Bool
    $c/= :: ScatterSeries -> ScatterSeries -> Bool
    /= :: ScatterSeries -> ScatterSeries -> Bool
    Eq, Int -> ScatterSeries -> ShowS
    [ScatterSeries] -> ShowS
    ScatterSeries -> String
    (Int -> ScatterSeries -> ShowS)
    -> (ScatterSeries -> String)
    -> ([ScatterSeries] -> ShowS)
    -> Show ScatterSeries
    forall a.
    (Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
    $cshowsPrec :: Int -> ScatterSeries -> ShowS
    showsPrec :: Int -> ScatterSeries -> ShowS
    $cshow :: ScatterSeries -> String
    show :: ScatterSeries -> String
    $cshowList :: [ScatterSeries] -> ShowS
    showList :: [ScatterSeries] -> ShowS
    Show, (forall x. ScatterSeries -> Rep ScatterSeries x)
    -> (forall x. Rep ScatterSeries x -> ScatterSeries)
    -> Generic ScatterSeries
    forall x. Rep ScatterSeries x -> ScatterSeries
    forall x. ScatterSeries -> Rep ScatterSeries x
    forall a.
    (forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
    $cfrom :: forall x. ScatterSeries -> Rep ScatterSeries x
    from :: forall x. ScatterSeries -> Rep ScatterSeries x
    $cto :: forall x. Rep ScatterSeries x -> ScatterSeries
    to :: forall x. Rep ScatterSeries x -> ScatterSeries
    Generic)
    instance NFData ScatterSeries

    -- See @CT_Marker@ (p. 4061)
    data DataMarker = DataMarker
      { DataMarker -> Maybe DataMarkerSymbol
    _dmrkSymbol :: Maybe DataMarkerSymbol
      , DataMarker -> Maybe Int
    _dmrkSize :: Maybe Int
        -- ^ integer between 2 and 72, specifying a size in points
      } deriving (DataMarker -> DataMarker -> Bool
    (DataMarker -> DataMarker -> Bool)
    -> (DataMarker -> DataMarker -> Bool) -> Eq DataMarker
    forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
    $c== :: DataMarker -> DataMarker -> Bool
    == :: DataMarker -> DataMarker -> Bool
    $c/= :: DataMarker -> DataMarker -> Bool
    /= :: DataMarker -> DataMarker -> Bool
    Eq, Int -> DataMarker -> ShowS
    [DataMarker] -> ShowS
    DataMarker -> String
    (Int -> DataMarker -> ShowS)
    -> (DataMarker -> String)
    -> ([DataMarker] -> ShowS)
    -> Show DataMarker
    forall a.
    (Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
    $cshowsPrec :: Int -> DataMarker -> ShowS
    showsPrec :: Int -> DataMarker -> ShowS
    $cshow :: DataMarker -> String
    show :: DataMarker -> String
    $cshowList :: [DataMarker] -> ShowS
    showList :: [DataMarker] -> ShowS
    Show, (forall x. DataMarker -> Rep DataMarker x)
    -> (forall x. Rep DataMarker x -> DataMarker) -> Generic DataMarker
    forall x. Rep DataMarker x -> DataMarker
    forall x. DataMarker -> Rep DataMarker x
    forall a.
    (forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
    $cfrom :: forall x. DataMarker -> Rep DataMarker x
    from :: forall x. DataMarker -> Rep DataMarker x
    $cto :: forall x. Rep DataMarker x -> DataMarker
    to :: forall x. Rep DataMarker x -> DataMarker
    Generic)
    instance NFData DataMarker

    data DataMarkerSymbol
      = DataMarkerCircle
      | DataMarkerDash
      | DataMarkerDiamond
      | DataMarkerDot
      | DataMarkerNone
      | DataMarkerPicture
      | DataMarkerPlus
      | DataMarkerSquare
      | DataMarkerStar
      | DataMarkerTriangle
      | DataMarkerX
      | DataMarkerAuto
      deriving (DataMarkerSymbol -> DataMarkerSymbol -> Bool
    (DataMarkerSymbol -> DataMarkerSymbol -> Bool)
    -> (DataMarkerSymbol -> DataMarkerSymbol -> Bool)
    -> Eq DataMarkerSymbol
    forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
    $c== :: DataMarkerSymbol -> DataMarkerSymbol -> Bool
    == :: DataMarkerSymbol -> DataMarkerSymbol -> Bool
    $c/= :: DataMarkerSymbol -> DataMarkerSymbol -> Bool
    /= :: DataMarkerSymbol -> DataMarkerSymbol -> Bool
    Eq, Int -> DataMarkerSymbol -> ShowS
    [DataMarkerSymbol] -> ShowS
    DataMarkerSymbol -> String
    (Int -> DataMarkerSymbol -> ShowS)
    -> (DataMarkerSymbol -> String)
    -> ([DataMarkerSymbol] -> ShowS)
    -> Show DataMarkerSymbol
    forall a.
    (Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
    $cshowsPrec :: Int -> DataMarkerSymbol -> ShowS
    showsPrec :: Int -> DataMarkerSymbol -> ShowS
    $cshow :: DataMarkerSymbol -> String
    show :: DataMarkerSymbol -> String
    $cshowList :: [DataMarkerSymbol] -> ShowS
    showList :: [DataMarkerSymbol] -> ShowS
    Show, (forall x. DataMarkerSymbol -> Rep DataMarkerSymbol x)
    -> (forall x. Rep DataMarkerSymbol x -> DataMarkerSymbol)
    -> Generic DataMarkerSymbol
    forall x. Rep DataMarkerSymbol x -> DataMarkerSymbol
    forall x. DataMarkerSymbol -> Rep DataMarkerSymbol x
    forall a.
    (forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
    $cfrom :: forall x. DataMarkerSymbol -> Rep DataMarkerSymbol x
    from :: forall x. DataMarkerSymbol -> Rep DataMarkerSymbol x
    $cto :: forall x. Rep DataMarkerSymbol x -> DataMarkerSymbol
    to :: forall x. Rep DataMarkerSymbol x -> DataMarkerSymbol
    Generic)
    instance NFData DataMarkerSymbol

    -- | Settings for the data labels for an entire series or the
    -- entire chart
    --
    -- TODO: numFmt, spPr, txPr, dLblPos, showBubbleSize,
    -- separator, showLeaderLines, leaderLines
    -- See 21.2.2.49 "dLbls (Data Labels)" (p. 3384)
    data DataLblProps = DataLblProps
      { DataLblProps -> Maybe Bool
    _dlblShowLegendKey :: Maybe Bool
      , DataLblProps -> Maybe Bool
    _dlblShowVal :: Maybe Bool
      , DataLblProps -> Maybe Bool
    _dlblShowCatName :: Maybe Bool
      , DataLblProps -> Maybe Bool
    _dlblShowSerName :: Maybe Bool
      , DataLblProps -> Maybe Bool
    _dlblShowPercent :: Maybe Bool
      } deriving (DataLblProps -> DataLblProps -> Bool
    (DataLblProps -> DataLblProps -> Bool)
    -> (DataLblProps -> DataLblProps -> Bool) -> Eq DataLblProps
    forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
    $c== :: DataLblProps -> DataLblProps -> Bool
    == :: DataLblProps -> DataLblProps -> Bool
    $c/= :: DataLblProps -> DataLblProps -> Bool
    /= :: DataLblProps -> DataLblProps -> Bool
    Eq, Int -> DataLblProps -> ShowS
    [DataLblProps] -> ShowS
    DataLblProps -> String
    (Int -> DataLblProps -> ShowS)
    -> (DataLblProps -> String)
    -> ([DataLblProps] -> ShowS)
    -> Show DataLblProps
    forall a.
    (Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
    $cshowsPrec :: Int -> DataLblProps -> ShowS
    showsPrec :: Int -> DataLblProps -> ShowS
    $cshow :: DataLblProps -> String
    show :: DataLblProps -> String
    $cshowList :: [DataLblProps] -> ShowS
    showList :: [DataLblProps] -> ShowS
    Show, (forall x. DataLblProps -> Rep DataLblProps x)
    -> (forall x. Rep DataLblProps x -> DataLblProps)
    -> Generic DataLblProps
    forall x. Rep DataLblProps x -> DataLblProps
    forall x. DataLblProps -> Rep DataLblProps x
    forall a.
    (forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
    $cfrom :: forall x. DataLblProps -> Rep DataLblProps x
    from :: forall x. DataLblProps -> Rep DataLblProps x
    $cto :: forall x. Rep DataLblProps x -> DataLblProps
    to :: forall x. Rep DataLblProps x -> DataLblProps
    Generic)
    instance NFData DataLblProps

    -- | Specifies the possible positions for tick marks.

    -- See 21.2.3.48 "ST_TickMark (Tick Mark)" (p. 3467)
    data TickMark
      = TickMarkCross
        -- ^ (Cross) Specifies the tick marks shall cross the axis.
      | TickMarkIn
        -- ^ (Inside) Specifies the tick marks shall be inside the plot area.
      | TickMarkNone
        -- ^ (None) Specifies there shall be no tick marks.
      | TickMarkOut
        -- ^ (Outside) Specifies the tick marks shall be outside the plot area.
      deriving (TickMark -> TickMark -> Bool
    (TickMark -> TickMark -> Bool)
    -> (TickMark -> TickMark -> Bool) -> Eq TickMark
    forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
    $c== :: TickMark -> TickMark -> Bool
    == :: TickMark -> TickMark -> Bool
    $c/= :: TickMark -> TickMark -> Bool
    /= :: TickMark -> TickMark -> Bool
    Eq, Int -> TickMark -> ShowS
    [TickMark] -> ShowS
    TickMark -> String
    (Int -> TickMark -> ShowS)
    -> (TickMark -> String) -> ([TickMark] -> ShowS) -> Show TickMark
    forall a.
    (Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
    $cshowsPrec :: Int -> TickMark -> ShowS
    showsPrec :: Int -> TickMark -> ShowS
    $cshow :: TickMark -> String
    show :: TickMark -> String
    $cshowList :: [TickMark] -> ShowS
    showList :: [TickMark] -> ShowS
    Show, (forall x. TickMark -> Rep TickMark x)
    -> (forall x. Rep TickMark x -> TickMark) -> Generic TickMark
    forall x. Rep TickMark x -> TickMark
    forall x. TickMark -> Rep TickMark x
    forall a.
    (forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
    $cfrom :: forall x. TickMark -> Rep TickMark x
    from :: forall x. TickMark -> Rep TickMark x
    $cto :: forall x. Rep TickMark x -> TickMark
    to :: forall x. Rep TickMark x -> TickMark
    Generic)
    instance NFData TickMark

    makeLenses ''DataPoint

    {-------------------------------------------------------------------------------
      Default instances
    -------------------------------------------------------------------------------}

    instance Default DataPoint where
        def :: DataPoint
    def = Maybe DataMarker -> Maybe ShapeProperties -> DataPoint
    DataPoint Maybe DataMarker
    forall a. Maybe a
    Nothing Maybe ShapeProperties
    forall a. Maybe a
    Nothing

    {-------------------------------------------------------------------------------
      Parsing
    -------------------------------------------------------------------------------}

    instance FromCursor ChartSpace where
      fromCursor :: Cursor -> [ChartSpace]
    fromCursor Cursor
    cur = do
        Cursor
    cur' <- Cursor
    cur Cursor -> (Cursor -> [Cursor]) -> [Cursor]
    forall node a. Cursor node -> (Cursor node -> [a]) -> [a]
    $/ Name -> Cursor -> [Cursor]
    element (Text -> Name
    c_ Text
    "chart")
        Maybe ChartTitle
    _chspTitle <- Name -> Cursor -> [Maybe ChartTitle]
    forall a. FromCursor a => Name -> Cursor -> [Maybe a]
    maybeFromElement (Text -> Name
    c_ Text
    "title") Cursor
    cur'
        let _chspCharts :: [Chart]
    _chspCharts =
              Cursor
    cur' Cursor -> (Cursor -> [Chart]) -> [Chart]
    forall node a. Cursor node -> (Cursor node -> [a]) -> [a]
    $/ Name -> Cursor -> [Cursor]
    element (Text -> Name
    c_ Text
    "plotArea") (Cursor -> [Cursor]) -> (Cursor -> [Chart]) -> Cursor -> [Chart]
    forall node a.
    Axis node -> (Cursor node -> [a]) -> Cursor node -> [a]
    &/ Cursor -> [Cursor]
    anyElement (Cursor -> [Cursor]) -> (Cursor -> [Chart]) -> Cursor -> [Chart]
    forall (m :: * -> *) a b c.
    Monad m =>
    (a -> m b) -> (b -> m c) -> a -> m c
    >=> Node -> [Chart]
    chartFromNode (Node -> [Chart]) -> (Cursor -> Node) -> Cursor -> [Chart]
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . Cursor -> Node
    forall node. Cursor node -> node
    node
        Maybe Legend
    _chspLegend <- Name -> Cursor -> [Maybe Legend]
    forall a. FromCursor a => Name -> Cursor -> [Maybe a]
    maybeFromElement (Text -> Name
    c_ Text
    "legend") Cursor
    cur'
        Maybe Bool
    _chspPlotVisOnly <- Name -> Cursor -> [Maybe Bool]
    maybeBoolElementValue (Text -> Name
    c_ Text
    "plotVisOnly") Cursor
    cur'
        Maybe DispBlanksAs
    _chspDispBlanksAs <- Name -> Cursor -> [Maybe DispBlanksAs]
    forall a. FromAttrVal a => Name -> Cursor -> [Maybe a]
    maybeElementValue (Text -> Name
    c_ Text
    "dispBlanksAs") Cursor
    cur'
        ChartSpace -> [ChartSpace]
    forall a. a -> [a]
    forall (m :: * -> *) a. Monad m => a -> m a
    return ChartSpace {[Chart]
    Maybe Bool
    Maybe Legend
    Maybe DispBlanksAs
    Maybe ChartTitle
    _chspTitle :: Maybe ChartTitle
    _chspCharts :: [Chart]
    _chspLegend :: Maybe Legend
    _chspPlotVisOnly :: Maybe Bool
    _chspDispBlanksAs :: Maybe DispBlanksAs
    _chspTitle :: Maybe ChartTitle
    _chspCharts :: [Chart]
    _chspLegend :: Maybe Legend
    _chspPlotVisOnly :: Maybe Bool
    _chspDispBlanksAs :: Maybe DispBlanksAs
    ..}

    chartFromNode :: Node -> [Chart]
    chartFromNode :: Node -> [Chart]
    chartFromNode Node
    n
      | Node
    n Node -> Name -> Bool
    `nodeElNameIs` (Text -> Name
    c_ Text
    "lineChart") = do
        ChartGrouping
    _lnchGrouping <- Name -> Cursor -> [ChartGrouping]
    forall a. FromAttrVal a => Name -> Cursor -> [a]
    fromElementValue (Text -> Name
    c_ Text
    "grouping") Cursor
    cur
        let _lnchSeries :: [LineSeries]
    _lnchSeries = Cursor
    cur Cursor -> (Cursor -> [LineSeries]) -> [LineSeries]
    forall node a. Cursor node -> (Cursor node -> [a]) -> [a]
    $/ Name -> Cursor -> [Cursor]
    element (Text -> Name
    c_ Text
    "ser") (Cursor -> [Cursor])
    -> (Cursor -> [LineSeries]) -> Cursor -> [LineSeries]
    forall (m :: * -> *) a b c.
    Monad m =>
    (a -> m b) -> (b -> m c) -> a -> m c
    >=> Cursor -> [LineSeries]
    forall a. FromCursor a => Cursor -> [a]
    fromCursor
        Maybe Bool
    _lnchMarker <- Name -> Cursor -> [Maybe Bool]
    maybeBoolElementValue (Text -> Name
    c_ Text
    "marker") Cursor
    cur
        Maybe Bool
    _lnchSmooth <- Name -> Cursor -> [Maybe Bool]
    maybeBoolElementValue (Text -> Name
    c_ Text
    "smooth") Cursor
    cur
        Chart -> [Chart]
    forall a. a -> [a]
    forall (m :: * -> *) a. Monad m => a -> m a
    return LineChart {[LineSeries]
    Maybe Bool
    ChartGrouping
    _lnchGrouping :: ChartGrouping
    _lnchSeries :: [LineSeries]
    _lnchMarker :: Maybe Bool
    _lnchSmooth :: Maybe Bool
    _lnchGrouping :: ChartGrouping
    _lnchSeries :: [LineSeries]
    _lnchMarker :: Maybe Bool
    _lnchSmooth :: Maybe Bool
    ..}
      | Node
    n Node -> Name -> Bool
    `nodeElNameIs` (Text -> Name
    c_ Text
    "areaChart") = do
        Maybe ChartGrouping
    _archGrouping <- Name -> Cursor -> [Maybe ChartGrouping]
    forall a. FromAttrVal a => Name -> Cursor -> [Maybe a]
    maybeElementValue (Text -> Name
    c_ Text
    "grouping") Cursor
    cur
        let _archSeries :: [AreaSeries]
    _archSeries = Cursor
    cur Cursor -> (Cursor -> [AreaSeries]) -> [AreaSeries]
    forall node a. Cursor node -> (Cursor node -> [a]) -> [a]
    $/ Name -> Cursor -> [Cursor]
    element (Text -> Name
    c_ Text
    "ser") (Cursor -> [Cursor])
    -> (Cursor -> [AreaSeries]) -> Cursor -> [AreaSeries]
    forall (m :: * -> *) a b c.
    Monad m =>
    (a -> m b) -> (b -> m c) -> a -> m c
    >=> Cursor -> [AreaSeries]
    forall a. FromCursor a => Cursor -> [a]
    fromCursor
        Chart -> [Chart]
    forall a. a -> [a]
    forall (m :: * -> *) a. Monad m => a -> m a
    return AreaChart {[AreaSeries]
    Maybe ChartGrouping
    _archGrouping :: Maybe ChartGrouping
    _archSeries :: [AreaSeries]
    _archGrouping :: Maybe ChartGrouping
    _archSeries :: [AreaSeries]
    ..}
      | Node
    n Node -> Name -> Bool
    `nodeElNameIs` (Text -> Name
    c_ Text
    "barChart") = do
        BarDirection
    _brchDirection <- Name -> Cursor -> [BarDirection]
    forall a. FromAttrVal a => Name -> Cursor -> [a]
    fromElementValue (Text -> Name
    c_ Text
    "barDir") Cursor
    cur
        Maybe BarChartGrouping
    _brchGrouping <-
          Name -> BarChartGrouping -> Cursor -> [Maybe BarChartGrouping]
    forall a. FromAttrVal a => Name -> a -> Cursor -> [Maybe a]
    maybeElementValueDef (Text -> Name
    c_ Text
    "grouping") BarChartGrouping
    BarClusteredGrouping Cursor
    cur
        let _brchSeries :: [BarSeries]
    _brchSeries = Cursor
    cur Cursor -> (Cursor -> [BarSeries]) -> [BarSeries]
    forall node a. Cursor node -> (Cursor node -> [a]) -> [a]
    $/ Name -> Cursor -> [Cursor]
    element (Text -> Name
    c_ Text
    "ser") (Cursor -> [Cursor])
    -> (Cursor -> [BarSeries]) -> Cursor -> [BarSeries]
    forall (m :: * -> *) a b c.
    Monad m =>
    (a -> m b) -> (b -> m c) -> a -> m c
    >=> Cursor -> [BarSeries]
    forall a. FromCursor a => Cursor -> [a]
    fromCursor
        Chart -> [Chart]
    forall a. a -> [a]
    forall (m :: * -> *) a. Monad m => a -> m a
    return BarChart {[BarSeries]
    Maybe BarChartGrouping
    BarDirection
    _brchDirection :: BarDirection
    _brchGrouping :: Maybe BarChartGrouping
    _brchSeries :: [BarSeries]
    _brchDirection :: BarDirection
    _brchGrouping :: Maybe BarChartGrouping
    _brchSeries :: [BarSeries]
    ..}
      | Node
    n Node -> Name -> Bool
    `nodeElNameIs` (Text -> Name
    c_ Text
    "pieChart") = do
        let _pichSeries :: [PieSeries]
    _pichSeries = Cursor
    cur Cursor -> (Cursor -> [PieSeries]) -> [PieSeries]
    forall node a. Cursor node -> (Cursor node -> [a]) -> [a]
    $/ Name -> Cursor -> [Cursor]
    element (Text -> Name
    c_ Text
    "ser") (Cursor -> [Cursor])
    -> (Cursor -> [PieSeries]) -> Cursor -> [PieSeries]
    forall (m :: * -> *) a b c.
    Monad m =>
    (a -> m b) -> (b -> m c) -> a -> m c
    >=> Cursor -> [PieSeries]
    forall a. FromCursor a => Cursor -> [a]
    fromCursor
        Chart -> [Chart]
    forall a. a -> [a]
    forall (m :: * -> *) a. Monad m => a -> m a
    return PieChart {[PieSeries]
    _pichSeries :: [PieSeries]
    _pichSeries :: [PieSeries]
    ..}
      | Node
    n Node -> Name -> Bool
    `nodeElNameIs` (Text -> Name
    c_ Text
    "scatterChart") = do
        ScatterStyle
    _scchStyle <- Name -> Cursor -> [ScatterStyle]
    forall a. FromAttrVal a => Name -> Cursor -> [a]
    fromElementValue (Text -> Name
    c_ Text
    "scatterStyle") Cursor
    cur
        let _scchSeries :: [ScatterSeries]
    _scchSeries = Cursor
    cur Cursor -> (Cursor -> [ScatterSeries]) -> [ScatterSeries]
    forall node a. Cursor node -> (Cursor node -> [a]) -> [a]
    $/ Name -> Cursor -> [Cursor]
    element (Text -> Name
    c_ Text
    "ser") (Cursor -> [Cursor])
    -> (Cursor -> [ScatterSeries]) -> Cursor -> [ScatterSeries]
    forall (m :: * -> *) a b c.
    Monad m =>
    (a -> m b) -> (b -> m c) -> a -> m c
    >=> Cursor -> [ScatterSeries]
    forall a. FromCursor a => Cursor -> [a]
    fromCursor
        Chart -> [Chart]
    forall a. a -> [a]
    forall (m :: * -> *) a. Monad m => a -> m a
    return ScatterChart {[ScatterSeries]
    ScatterStyle
    _scchStyle :: ScatterStyle
    _scchSeries :: [ScatterSeries]
    _scchStyle :: ScatterStyle
    _scchSeries :: [ScatterSeries]
    ..}
      | Bool
    otherwise = String -> [Chart]
    forall a. String -> [a]
    forall (m :: * -> *) a. MonadFail m => String -> m a
    fail String
    "no matching chart node"
      where
        cur :: Cursor
    cur = Node -> Cursor
    fromNode Node
    n

    instance FromCursor LineSeries where
      fromCursor :: Cursor -> [LineSeries]
    fromCursor Cursor
    cur = do
        Series
    _lnserShared <- Cursor -> [Series]
    forall a. FromCursor a => Cursor -> [a]
    fromCursor Cursor
    cur
        Maybe DataMarker
    _lnserMarker <- Name -> Cursor -> [Maybe DataMarker]
    forall a. FromCursor a => Name -> Cursor -> [Maybe a]
    maybeFromElement (Text -> Name
    c_ Text
    "marker") Cursor
    cur
        Maybe DataLblProps
    _lnserDataLblProps <- Name -> Cursor -> [Maybe DataLblProps]
    forall a. FromCursor a => Name -> Cursor -> [Maybe a]
    maybeFromElement (Text -> Name
    c_ Text
    "dLbls") Cursor
    cur
        Maybe Formula
    _lnserVal <-
          Cursor
    cur Cursor -> (Cursor -> [Maybe Formula]) -> [Maybe Formula]
    forall node a. Cursor node -> (Cursor node -> [a]) -> [a]
    $/ Name -> Cursor -> [Cursor]
    element (Text -> Name
    c_ Text
    "val") (Cursor -> [Cursor])
    -> (Cursor -> [Maybe Formula]) -> Cursor -> [Maybe Formula]
    forall node a.
    Axis node -> (Cursor node -> [a]) -> Cursor node -> [a]
    &/ Name -> Cursor -> [Cursor]
    element (Text -> Name
    c_ Text
    "numRef") (Cursor -> [Cursor])
    -> (Cursor -> [Maybe Formula]) -> Cursor -> [Maybe Formula]
    forall (m :: * -> *) a b c.
    Monad m =>
    (a -> m b) -> (b -> m c) -> a -> m c
    >=>
          Name -> Cursor -> [Maybe Formula]
    forall a. FromCursor a => Name -> Cursor -> [Maybe a]
    maybeFromElement (Text -> Name
    c_ Text
    "f")
        Maybe Bool
    _lnserSmooth <- Name -> Bool -> Cursor -> [Maybe Bool]
    forall a. FromAttrVal a => Name -> a -> Cursor -> [Maybe a]
    maybeElementValueDef (Text -> Name
    c_ Text
    "smooth") Bool
    True Cursor
    cur
        LineSeries -> [LineSeries]
    forall a. a -> [a]
    forall (m :: * -> *) a. Monad m => a -> m a
    return LineSeries {Maybe Bool
    Maybe Formula
    Maybe DataLblProps
    Maybe DataMarker
    Series
    _lnserShared :: Series
    _lnserMarker :: Maybe DataMarker
    _lnserDataLblProps :: Maybe DataLblProps
    _lnserVal :: Maybe Formula
    _lnserSmooth :: Maybe Bool
    _lnserShared :: Series
    _lnserMarker :: Maybe DataMarker
    _lnserDataLblProps :: Maybe DataLblProps
    _lnserVal :: Maybe Formula
    _lnserSmooth :: Maybe Bool
    ..}

    instance FromCursor AreaSeries where
      fromCursor :: Cursor -> [AreaSeries]
    fromCursor Cursor
    cur = do
        Series
    _arserShared <- Cursor -> [Series]
    forall a. FromCursor a => Cursor -> [a]
    fromCursor Cursor
    cur
        Maybe DataLblProps
    _arserDataLblProps <- Name -> Cursor -> [Maybe DataLblProps]
    forall a. FromCursor a => Name -> Cursor -> [Maybe a]
    maybeFromElement (Text -> Name
    c_ Text
    "dLbls") Cursor
    cur
        Maybe Formula
    _arserVal <-
          Cursor
    cur Cursor -> (Cursor -> [Maybe Formula]) -> [Maybe Formula]
    forall node a. Cursor node -> (Cursor node -> [a]) -> [a]
    $/ Name -> Cursor -> [Cursor]
    element (Text -> Name
    c_ Text
    "val") (Cursor -> [Cursor])
    -> (Cursor -> [Maybe Formula]) -> Cursor -> [Maybe Formula]
    forall node a.
    Axis node -> (Cursor node -> [a]) -> Cursor node -> [a]
    &/ Name -> Cursor -> [Cursor]
    element (Text -> Name
    c_ Text
    "numRef") (Cursor -> [Cursor])
    -> (Cursor -> [Maybe Formula]) -> Cursor -> [Maybe Formula]
    forall (m :: * -> *) a b c.
    Monad m =>
    (a -> m b) -> (b -> m c) -> a -> m c
    >=>
          Name -> Cursor -> [Maybe Formula]
    forall a. FromCursor a => Name -> Cursor -> [Maybe a]
    maybeFromElement (Text -> Name
    c_ Text
    "f")
        AreaSeries -> [AreaSeries]
    forall a. a -> [a]
    forall (m :: * -> *) a. Monad m => a -> m a
    return AreaSeries {Maybe Formula
    Maybe DataLblProps
    Series
    _arserShared :: Series
    _arserDataLblProps :: Maybe DataLblProps
    _arserVal :: Maybe Formula
    _arserShared :: Series
    _arserDataLblProps :: Maybe DataLblProps
    _arserVal :: Maybe Formula
    ..}

    instance FromCursor BarSeries where
      fromCursor :: Cursor -> [BarSeries]
    fromCursor Cursor
    cur = do
        Series
    _brserShared <- Cursor -> [Series]
    forall a. FromCursor a => Cursor -> [a]
    fromCursor Cursor
    cur
        Maybe DataLblProps
    _brserDataLblProps <- Name -> Cursor -> [Maybe DataLblProps]
    forall a. FromCursor a => Name -> Cursor -> [Maybe a]
    maybeFromElement (Text -> Name
    c_ Text
    "dLbls") Cursor
    cur
        Maybe Formula
    _brserVal <-
          Cursor
    cur Cursor -> (Cursor -> [Maybe Formula]) -> [Maybe Formula]
    forall node a. Cursor node -> (Cursor node -> [a]) -> [a]
    $/ Name -> Cursor -> [Cursor]
    element (Text -> Name
    c_ Text
    "val") (Cursor -> [Cursor])
    -> (Cursor -> [Maybe Formula]) -> Cursor -> [Maybe Formula]
    forall node a.
    Axis node -> (Cursor node -> [a]) -> Cursor node -> [a]
    &/ Name -> Cursor -> [Cursor]
    element (Text -> Name
    c_ Text
    "numRef") (Cursor -> [Cursor])
    -> (Cursor -> [Maybe Formula]) -> Cursor -> [Maybe Formula]
    forall (m :: * -> *) a b c.
    Monad m =>
    (a -> m b) -> (b -> m c) -> a -> m c
    >=>
          Name -> Cursor -> [Maybe Formula]
    forall a. FromCursor a => Name -> Cursor -> [Maybe a]
    maybeFromElement (Text -> Name
    c_ Text
    "f")
        BarSeries -> [BarSeries]
    forall a. a -> [a]
    forall (m :: * -> *) a. Monad m => a -> m a
    return BarSeries {Maybe Formula
    Maybe DataLblProps
    Series
    _brserShared :: Series
    _brserDataLblProps :: Maybe DataLblProps
    _brserVal :: Maybe Formula
    _brserShared :: Series
    _brserDataLblProps :: Maybe DataLblProps
    _brserVal :: Maybe Formula
    ..}

    instance FromCursor PieSeries where
      fromCursor :: Cursor -> [PieSeries]
    fromCursor Cursor
    cur = do
        Series
    _piserShared <- Cursor -> [Series]
    forall a. FromCursor a => Cursor -> [a]
    fromCursor Cursor
    cur
        let _piserDataPoints :: [DataPoint]
    _piserDataPoints = Cursor
    cur Cursor -> (Cursor -> [DataPoint]) -> [DataPoint]
    forall node a. Cursor node -> (Cursor node -> [a]) -> [a]
    $/ Name -> Cursor -> [Cursor]
    element (Text -> Name
    c_ Text
    "dPt") (Cursor -> [Cursor])
    -> (Cursor -> [DataPoint]) -> Cursor -> [DataPoint]
    forall (m :: * -> *) a b c.
    Monad m =>
    (a -> m b) -> (b -> m c) -> a -> m c
    >=> Cursor -> [DataPoint]
    forall a. FromCursor a => Cursor -> [a]
    fromCursor
        Maybe DataLblProps
    _piserDataLblProps <- Name -> Cursor -> [Maybe DataLblProps]
    forall a. FromCursor a => Name -> Cursor -> [Maybe a]
    maybeFromElement (Text -> Name
    c_ Text
    "dLbls") Cursor
    cur
        Maybe Formula
    _piserVal <-
          Cursor
    cur Cursor -> (Cursor -> [Maybe Formula]) -> [Maybe Formula]
    forall node a. Cursor node -> (Cursor node -> [a]) -> [a]
    $/ Name -> Cursor -> [Cursor]
    element (Text -> Name
    c_ Text
    "val") (Cursor -> [Cursor])
    -> (Cursor -> [Maybe Formula]) -> Cursor -> [Maybe Formula]
    forall node a.
    Axis node -> (Cursor node -> [a]) -> Cursor node -> [a]
    &/ Name -> Cursor -> [Cursor]
    element (Text -> Name
    c_ Text
    "numRef") (Cursor -> [Cursor])
    -> (Cursor -> [Maybe Formula]) -> Cursor -> [Maybe Formula]
    forall (m :: * -> *) a b c.
    Monad m =>
    (a -> m b) -> (b -> m c) -> a -> m c
    >=>
          Name -> Cursor -> [Maybe Formula]
    forall a. FromCursor a => Name -> Cursor -> [Maybe a]
    maybeFromElement (Text -> Name
    c_ Text
    "f")
        PieSeries -> [PieSeries]
    forall a. a -> [a]
    forall (m :: * -> *) a. Monad m => a -> m a
    return PieSeries {[DataPoint]
    Maybe Formula
    Maybe DataLblProps
    Series
    _piserShared :: Series
    _piserDataPoints :: [DataPoint]
    _piserDataLblProps :: Maybe DataLblProps
    _piserVal :: Maybe Formula
    _piserShared :: Series
    _piserDataPoints :: [DataPoint]
    _piserDataLblProps :: Maybe DataLblProps
    _piserVal :: Maybe Formula
    ..}

    instance FromCursor ScatterSeries where
      fromCursor :: Cursor -> [ScatterSeries]
    fromCursor Cursor
    cur = do
        Series
    _scserShared <- Cursor -> [Series]
    forall a. FromCursor a => Cursor -> [a]
    fromCursor Cursor
    cur
        Maybe DataMarker
    _scserMarker <- Name -> Cursor -> [Maybe DataMarker]
    forall a. FromCursor a => Name -> Cursor -> [Maybe a]
    maybeFromElement (Text -> Name
    c_ Text
    "marker") Cursor
    cur
        Maybe DataLblProps
    _scserDataLblProps <- Name -> Cursor -> [Maybe DataLblProps]
    forall a. FromCursor a => Name -> Cursor -> [Maybe a]
    maybeFromElement (Text -> Name
    c_ Text
    "dLbls") Cursor
    cur
        Maybe Formula
    _scserXVal <-
          Cursor
    cur Cursor -> (Cursor -> [Maybe Formula]) -> [Maybe Formula]
    forall node a. Cursor node -> (Cursor node -> [a]) -> [a]
    $/ Name -> Cursor -> [Cursor]
    element (Text -> Name
    c_ Text
    "xVal") (Cursor -> [Cursor])
    -> (Cursor -> [Maybe Formula]) -> Cursor -> [Maybe Formula]
    forall node a.
    Axis node -> (Cursor node -> [a]) -> Cursor node -> [a]
    &/ Name -> Cursor -> [Cursor]
    element (Text -> Name
    c_ Text
    "numRef") (Cursor -> [Cursor])
    -> (Cursor -> [Maybe Formula]) -> Cursor -> [Maybe Formula]
    forall (m :: * -> *) a b c.
    Monad m =>
    (a -> m b) -> (b -> m c) -> a -> m c
    >=>
          Name -> Cursor -> [Maybe Formula]
    forall a. FromCursor a => Name -> Cursor -> [Maybe a]
    maybeFromElement (Text -> Name
    c_ Text
    "f")
        Maybe Formula
    _scserYVal <-
          Cursor
    cur Cursor -> (Cursor -> [Maybe Formula]) -> [Maybe Formula]
    forall node a. Cursor node -> (Cursor node -> [a]) -> [a]
    $/ Name -> Cursor -> [Cursor]
    element (Text -> Name
    c_ Text
    "yVal") (Cursor -> [Cursor])
    -> (Cursor -> [Maybe Formula]) -> Cursor -> [Maybe Formula]
    forall node a.
    Axis node -> (Cursor node -> [a]) -> Cursor node -> [a]
    &/ Name -> Cursor -> [Cursor]
    element (Text -> Name
    c_ Text
    "numRef") (Cursor -> [Cursor])
    -> (Cursor -> [Maybe Formula]) -> Cursor -> [Maybe Formula]
    forall (m :: * -> *) a b c.
    Monad m =>
    (a -> m b) -> (b -> m c) -> a -> m c
    >=>
          Name -> Cursor -> [Maybe Formula]
    forall a. FromCursor a => Name -> Cursor -> [Maybe a]
    maybeFromElement (Text -> Name
    c_ Text
    "f")
        Maybe Bool
    _scserSmooth <- Name -> Bool -> Cursor -> [Maybe Bool]
    forall a. FromAttrVal a => Name -> a -> Cursor -> [Maybe a]
    maybeElementValueDef (Text -> Name
    c_ Text
    "smooth") Bool
    True Cursor
    cur
        ScatterSeries -> [ScatterSeries]
    forall a. a -> [a]
    forall (m :: * -> *) a. Monad m => a -> m a
    return ScatterSeries {Maybe Bool
    Maybe Formula
    Maybe DataLblProps
    Maybe DataMarker
    Series
    _scserShared :: Series
    _scserMarker :: Maybe DataMarker
    _scserDataLblProps :: Maybe DataLblProps
    _scserXVal :: Maybe Formula
    _scserYVal :: Maybe Formula
    _scserSmooth :: Maybe Bool
    _scserShared :: Series
    _scserMarker :: Maybe DataMarker
    _scserDataLblProps :: Maybe DataLblProps
    _scserXVal :: Maybe Formula
    _scserYVal :: Maybe Formula
    _scserSmooth :: Maybe Bool
    ..}

    -- should we respect idx and order?
    instance FromCursor Series where
      fromCursor :: Cursor -> [Series]
    fromCursor Cursor
    cur = do
        Maybe Formula
    _serTx <-
          Cursor
    cur Cursor -> (Cursor -> [Maybe Formula]) -> [Maybe Formula]
    forall node a. Cursor node -> (Cursor node -> [a]) -> [a]
    $/ Name -> Cursor -> [Cursor]
    element (Text -> Name
    c_ Text
    "tx") (Cursor -> [Cursor])
    -> (Cursor -> [Maybe Formula]) -> Cursor -> [Maybe Formula]
    forall node a.
    Axis node -> (Cursor node -> [a]) -> Cursor node -> [a]
    &/ Name -> Cursor -> [Cursor]
    element (Text -> Name
    c_ Text
    "strRef") (Cursor -> [Cursor])
    -> (Cursor -> [Maybe Formula]) -> Cursor -> [Maybe Formula]
    forall (m :: * -> *) a b c.
    Monad m =>
    (a -> m b) -> (b -> m c) -> a -> m c
    >=>
          Name -> Cursor -> [Maybe Formula]
    forall a. FromCursor a => Name -> Cursor -> [Maybe a]
    maybeFromElement (Text -> Name
    c_ Text
    "f")
        Maybe ShapeProperties
    _serShapeProperties <- Name -> Cursor -> [Maybe ShapeProperties]
    forall a. FromCursor a => Name -> Cursor -> [Maybe a]
    maybeFromElement (Text -> Name
    c_ Text
    "spPr") Cursor
    cur
        Series -> [Series]
    forall a. a -> [a]
    forall (m :: * -> *) a. Monad m => a -> m a
    return Series {Maybe ShapeProperties
    Maybe Formula
    _serTx :: Maybe Formula
    _serShapeProperties :: Maybe ShapeProperties
    _serTx :: Maybe Formula
    _serShapeProperties :: Maybe ShapeProperties
    ..}

    instance FromCursor DataMarker where
      fromCursor :: Cursor -> [DataMarker]
    fromCursor Cursor
    cur = do
        Maybe DataMarkerSymbol
    _dmrkSymbol <- Name -> Cursor -> [Maybe DataMarkerSymbol]
    forall a. FromAttrVal a => Name -> Cursor -> [Maybe a]
    maybeElementValue (Text -> Name
    c_ Text
    "symbol") Cursor
    cur
        Maybe Int
    _dmrkSize <- Name -> Cursor -> [Maybe Int]
    forall a. FromAttrVal a => Name -> Cursor -> [Maybe a]
    maybeElementValue (Text -> Name
    c_ Text
    "size") Cursor
    cur
        DataMarker -> [DataMarker]
    forall a. a -> [a]
    forall (m :: * -> *) a. Monad m => a -> m a
    return DataMarker {Maybe Int
    Maybe DataMarkerSymbol
    _dmrkSymbol :: Maybe DataMarkerSymbol
    _dmrkSize :: Maybe Int
    _dmrkSymbol :: Maybe DataMarkerSymbol
    _dmrkSize :: Maybe Int
    ..}

    instance FromCursor DataPoint where
      fromCursor :: Cursor -> [DataPoint]
    fromCursor Cursor
    cur = do
        Maybe DataMarker
    _dpMarker <- Name -> Cursor -> [Maybe DataMarker]
    forall a. FromCursor a => Name -> Cursor -> [Maybe a]
    maybeFromElement (Text -> Name
    c_ Text
    "marker") Cursor
    cur
        Maybe ShapeProperties
    _dpShapeProperties <- Name -> Cursor -> [Maybe ShapeProperties]
    forall a. FromCursor a => Name -> Cursor -> [Maybe a]
    maybeFromElement (Text -> Name
    c_ Text
    "spPr") Cursor
    cur
        DataPoint -> [DataPoint]
    forall a. a -> [a]
    forall (m :: * -> *) a. Monad m => a -> m a
    return DataPoint {Maybe ShapeProperties
    Maybe DataMarker
    _dpMarker :: Maybe DataMarker
    _dpShapeProperties :: Maybe ShapeProperties
    _dpMarker :: Maybe DataMarker
    _dpShapeProperties :: Maybe ShapeProperties
    ..}

    instance FromAttrVal DataMarkerSymbol where
      fromAttrVal :: Reader DataMarkerSymbol
    fromAttrVal Text
    "circle" = DataMarkerSymbol -> Either String (DataMarkerSymbol, Text)
    forall a. a -> Either String (a, Text)
    readSuccess DataMarkerSymbol
    DataMarkerCircle
      fromAttrVal Text
    "dash" = DataMarkerSymbol -> Either String (DataMarkerSymbol, Text)
    forall a. a -> Either String (a, Text)
    readSuccess DataMarkerSymbol
    DataMarkerDash
      fromAttrVal Text
    "diamond" = DataMarkerSymbol -> Either String (DataMarkerSymbol, Text)
    forall a. a -> Either String (a, Text)
    readSuccess DataMarkerSymbol
    DataMarkerDiamond
      fromAttrVal Text
    "dot" = DataMarkerSymbol -> Either String (DataMarkerSymbol, Text)
    forall a. a -> Either String (a, Text)
    readSuccess DataMarkerSymbol
    DataMarkerDot
      fromAttrVal Text
    "none" = DataMarkerSymbol -> Either String (DataMarkerSymbol, Text)
    forall a. a -> Either String (a, Text)
    readSuccess DataMarkerSymbol
    DataMarkerNone
      fromAttrVal Text
    "picture" = DataMarkerSymbol -> Either String (DataMarkerSymbol, Text)
    forall a. a -> Either String (a, Text)
    readSuccess DataMarkerSymbol
    DataMarkerPicture
      fromAttrVal Text
    "plus" = DataMarkerSymbol -> Either String (DataMarkerSymbol, Text)
    forall a. a -> Either String (a, Text)
    readSuccess DataMarkerSymbol
    DataMarkerPlus
      fromAttrVal Text
    "square" = DataMarkerSymbol -> Either String (DataMarkerSymbol, Text)
    forall a. a -> Either String (a, Text)
    readSuccess DataMarkerSymbol
    DataMarkerSquare
      fromAttrVal Text
    "star" = DataMarkerSymbol -> Either String (DataMarkerSymbol, Text)
    forall a. a -> Either String (a, Text)
    readSuccess DataMarkerSymbol
    DataMarkerStar
      fromAttrVal Text
    "triangle" = DataMarkerSymbol -> Either String (DataMarkerSymbol, Text)
    forall a. a -> Either String (a, Text)
    readSuccess DataMarkerSymbol
    DataMarkerTriangle
      fromAttrVal Text
    "x" = DataMarkerSymbol -> Either String (DataMarkerSymbol, Text)
    forall a. a -> Either String (a, Text)
    readSuccess DataMarkerSymbol
    DataMarkerX
      fromAttrVal Text
    "auto" = DataMarkerSymbol -> Either String (DataMarkerSymbol, Text)
    forall a. a -> Either String (a, Text)
    readSuccess DataMarkerSymbol
    DataMarkerAuto
      fromAttrVal Text
    t = Text -> Reader DataMarkerSymbol
    forall a. Text -> Text -> Either String (a, Text)
    invalidText Text
    "DataMarkerSymbol" Text
    t

    instance FromAttrVal BarDirection where
      fromAttrVal :: Reader BarDirection
    fromAttrVal Text
    "bar" = BarDirection -> Either String (BarDirection, Text)
    forall a. a -> Either String (a, Text)
    readSuccess BarDirection
    DirectionBar
      fromAttrVal Text
    "col" = BarDirection -> Either String (BarDirection, Text)
    forall a. a -> Either String (a, Text)
    readSuccess BarDirection
    DirectionColumn
      fromAttrVal Text
    t = Text -> Reader BarDirection
    forall a. Text -> Text -> Either String (a, Text)
    invalidText Text
    "BarDirection" Text
    t

    instance FromAttrVal ScatterStyle where
      fromAttrVal :: Reader ScatterStyle
    fromAttrVal Text
    "none" = ScatterStyle -> Either String (ScatterStyle, Text)
    forall a. a -> Either String (a, Text)
    readSuccess ScatterStyle
    ScatterNone
      fromAttrVal Text
    "line" = ScatterStyle -> Either String (ScatterStyle, Text)
    forall a. a -> Either String (a, Text)
    readSuccess ScatterStyle
    ScatterLine
      fromAttrVal Text
    "lineMarker" = ScatterStyle -> Either String (ScatterStyle, Text)
    forall a. a -> Either String (a, Text)
    readSuccess ScatterStyle
    ScatterLineMarker
      fromAttrVal Text
    "marker" = ScatterStyle -> Either String (ScatterStyle, Text)
    forall a. a -> Either String (a, Text)
    readSuccess ScatterStyle
    ScatterMarker
      fromAttrVal Text
    "smooth" = ScatterStyle -> Either String (ScatterStyle, Text)
    forall a. a -> Either String (a, Text)
    readSuccess ScatterStyle
    ScatterSmooth
      fromAttrVal Text
    "smoothMarker" = ScatterStyle -> Either String (ScatterStyle, Text)
    forall a. a -> Either String (a, Text)
    readSuccess ScatterStyle
    ScatterSmoothMarker
      fromAttrVal Text
    t = Text -> Reader ScatterStyle
    forall a. Text -> Text -> Either String (a, Text)
    invalidText Text
    "ScatterStyle" Text
    t

    instance FromCursor DataLblProps where
      fromCursor :: Cursor -> [DataLblProps]
    fromCursor Cursor
    cur = do
        Maybe Bool
    _dlblShowLegendKey <- Name -> Cursor -> [Maybe Bool]
    maybeBoolElementValue (Text -> Name
    c_ Text
    "showLegendKey") Cursor
    cur
        Maybe Bool
    _dlblShowVal <- Name -> Cursor -> [Maybe Bool]
    maybeBoolElementValue (Text -> Name
    c_ Text
    "showVal") Cursor
    cur
        Maybe Bool
    _dlblShowCatName <- Name -> Cursor -> [Maybe Bool]
    maybeBoolElementValue (Text -> Name
    c_ Text
    "showCatName") Cursor
    cur
        Maybe Bool
    _dlblShowSerName <- Name -> Cursor -> [Maybe Bool]
    maybeBoolElementValue (Text -> Name
    c_ Text
    "showSerName") Cursor
    cur
        Maybe Bool
    _dlblShowPercent <- Name -> Cursor -> [Maybe Bool]
    maybeBoolElementValue (Text -> Name
    c_ Text
    "showPercent") Cursor
    cur
        DataLblProps -> [DataLblProps]
    forall a. a -> [a]
    forall (m :: * -> *) a. Monad m => a -> m a
    return DataLblProps {Maybe Bool
    _dlblShowLegendKey :: Maybe Bool
    _dlblShowVal :: Maybe Bool
    _dlblShowCatName :: Maybe Bool
    _dlblShowSerName :: Maybe Bool
    _dlblShowPercent :: Maybe Bool
    _dlblShowLegendKey :: Maybe Bool
    _dlblShowVal :: Maybe Bool
    _dlblShowCatName :: Maybe Bool
    _dlblShowSerName :: Maybe Bool
    _dlblShowPercent :: Maybe Bool
    ..}

    instance FromAttrVal ChartGrouping where
      fromAttrVal :: Reader ChartGrouping
    fromAttrVal Text
    "percentStacked" = ChartGrouping -> Either String (ChartGrouping, Text)
    forall a. a -> Either String (a, Text)
    readSuccess ChartGrouping
    PercentStackedGrouping
      fromAttrVal Text
    "standard" = ChartGrouping -> Either String (ChartGrouping, Text)
    forall a. a -> Either String (a, Text)
    readSuccess ChartGrouping
    StandardGrouping
      fromAttrVal Text
    "stacked" = ChartGrouping -> Either String (ChartGrouping, Text)
    forall a. a -> Either String (a, Text)
    readSuccess ChartGrouping
    StackedGrouping
      fromAttrVal Text
    t = Text -> Reader ChartGrouping
    forall a. Text -> Text -> Either String (a, Text)
    invalidText Text
    "ChartGrouping" Text
    t

    instance FromAttrVal BarChartGrouping where
      fromAttrVal :: Reader BarChartGrouping
    fromAttrVal Text
    "clustered" = BarChartGrouping -> Either String (BarChartGrouping, Text)
    forall a. a -> Either String (a, Text)
    readSuccess BarChartGrouping
    BarClusteredGrouping
      fromAttrVal Text
    "percentStacked" = BarChartGrouping -> Either String (BarChartGrouping, Text)
    forall a. a -> Either String (a, Text)
    readSuccess BarChartGrouping
    BarPercentStackedGrouping
      fromAttrVal Text
    "standard" = BarChartGrouping -> Either String (BarChartGrouping, Text)
    forall a. a -> Either String (a, Text)
    readSuccess BarChartGrouping
    BarStandardGrouping
      fromAttrVal Text
    "stacked" = BarChartGrouping -> Either String (BarChartGrouping, Text)
    forall a. a -> Either String (a, Text)
    readSuccess BarChartGrouping
    BarStackedGrouping
      fromAttrVal Text
    t = Text -> Reader BarChartGrouping
    forall a. Text -> Text -> Either String (a, Text)
    invalidText Text
    "BarChartGrouping" Text
    t

    instance FromCursor ChartTitle where
      fromCursor :: Cursor -> [ChartTitle]
    fromCursor Cursor
    cur = do
        let mTitle :: Maybe TextBody
    mTitle = [TextBody] -> Maybe TextBody
    forall a. [a] -> Maybe a
    listToMaybe ([TextBody] -> Maybe TextBody) -> [TextBody] -> Maybe TextBody
    forall a b. (a -> b) -> a -> b
    $
              Cursor
    cur Cursor -> (Cursor -> [TextBody]) -> [TextBody]
    forall node a. Cursor node -> (Cursor node -> [a]) -> [a]
    $/ Name -> Cursor -> [Cursor]
    element (Text -> Name
    c_ Text
    "tx") (Cursor -> [Cursor])
    -> (Cursor -> [TextBody]) -> Cursor -> [TextBody]
    forall node a.
    Axis node -> (Cursor node -> [a]) -> Cursor node -> [a]
    &/ Name -> Cursor -> [Cursor]
    element (Text -> Name
    c_ Text
    "rich") (Cursor -> [Cursor])
    -> (Cursor -> [TextBody]) -> Cursor -> [TextBody]
    forall (m :: * -> *) a b c.
    Monad m =>
    (a -> m b) -> (b -> m c) -> a -> m c
    >=> Cursor -> [TextBody]
    forall a. FromCursor a => Cursor -> [a]
    fromCursor
        ChartTitle -> [ChartTitle]
    forall a. a -> [a]
    forall (m :: * -> *) a. Monad m => a -> m a
    return (ChartTitle -> [ChartTitle]) -> ChartTitle -> [ChartTitle]
    forall a b. (a -> b) -> a -> b
    $ Maybe TextBody -> ChartTitle
    ChartTitle Maybe TextBody
    mTitle

    instance FromCursor Legend where
      fromCursor :: Cursor -> [Legend]
    fromCursor Cursor
    cur = do
        Maybe LegendPos
    _legendPos <- Name -> Cursor -> [Maybe LegendPos]
    forall a. FromAttrVal a => Name -> Cursor -> [Maybe a]
    maybeElementValue (Text -> Name
    c_ Text
    "legendPos") Cursor
    cur
        Maybe Bool
    _legendOverlay <- Name -> Bool -> Cursor -> [Maybe Bool]
    forall a. FromAttrVal a => Name -> a -> Cursor -> [Maybe a]
    maybeElementValueDef (Text -> Name
    c_ Text
    "overlay") Bool
    True Cursor
    cur
        Legend -> [Legend]
    forall a. a -> [a]
    forall (m :: * -> *) a. Monad m => a -> m a
    return Legend {Maybe Bool
    Maybe LegendPos
    _legendPos :: Maybe LegendPos
    _legendOverlay :: Maybe Bool
    _legendPos :: Maybe LegendPos
    _legendOverlay :: Maybe Bool
    ..}

    instance FromAttrVal LegendPos where
      fromAttrVal :: Reader LegendPos
    fromAttrVal Text
    "b" = LegendPos -> Either String (LegendPos, Text)
    forall a. a -> Either String (a, Text)
    readSuccess LegendPos
    LegendBottom
      fromAttrVal Text
    "l" = LegendPos -> Either String (LegendPos, Text)
    forall a. a -> Either String (a, Text)
    readSuccess LegendPos
    LegendLeft
      fromAttrVal Text
    "r" = LegendPos -> Either String (LegendPos, Text)
    forall a. a -> Either String (a, Text)
    readSuccess LegendPos
    LegendRight
      fromAttrVal Text
    "t" = LegendPos -> Either String (LegendPos, Text)
    forall a. a -> Either String (a, Text)
    readSuccess LegendPos
    LegendTop
      fromAttrVal Text
    "tr" = LegendPos -> Either String (LegendPos, Text)
    forall a. a -> Either String (a, Text)
    readSuccess LegendPos
    LegendTopRight
      fromAttrVal Text
    t = Text -> Reader LegendPos
    forall a. Text -> Text -> Either String (a, Text)
    invalidText Text
    "LegendPos" Text
    t

    instance FromAttrVal DispBlanksAs where
      fromAttrVal :: Reader DispBlanksAs
    fromAttrVal Text
    "gap" = DispBlanksAs -> Either String (DispBlanksAs, Text)
    forall a. a -> Either String (a, Text)
    readSuccess DispBlanksAs
    DispBlanksAsGap
      fromAttrVal Text
    "span" = DispBlanksAs -> Either String (DispBlanksAs, Text)
    forall a. a -> Either String (a, Text)
    readSuccess DispBlanksAs
    DispBlanksAsSpan
      fromAttrVal Text
    "zero" = DispBlanksAs -> Either String (DispBlanksAs, Text)
    forall a. a -> Either String (a, Text)
    readSuccess DispBlanksAs
    DispBlanksAsZero
      fromAttrVal Text
    t = Text -> Reader DispBlanksAs
    forall a. Text -> Text -> Either String (a, Text)
    invalidText Text
    "DispBlanksAs" Text
    t

    {-------------------------------------------------------------------------------
      Default instances
    -------------------------------------------------------------------------------}

    instance Default Legend where
      def :: Legend
    def = Legend {_legendPos :: Maybe LegendPos
    _legendPos = LegendPos -> Maybe LegendPos
    forall a. a -> Maybe a
    Just LegendPos
    LegendBottom, _legendOverlay :: Maybe Bool
    _legendOverlay = Bool -> Maybe Bool
    forall a. a -> Maybe a
    Just Bool
    False}

    {-------------------------------------------------------------------------------
      Rendering
    -------------------------------------------------------------------------------}

    instance ToDocument ChartSpace where
      toDocument :: ChartSpace -> Document
    toDocument =
        Text -> Text -> Maybe Text -> Element -> Document
    documentFromNsPrefElement Text
    "Charts generated by xlsx" Text
    chartNs (Text -> Maybe Text
    forall a. a -> Maybe a
    Just Text
    "c") (Element -> Document)
    -> (ChartSpace -> Element) -> ChartSpace -> Document
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    .
        Name -> ChartSpace -> Element
    forall a. ToElement a => Name -> a -> Element
    toElement Name
    "chartSpace"

    instance ToElement ChartSpace where
      toElement :: Name -> ChartSpace -> Element
    toElement Name
    nm ChartSpace {[Chart]
    Maybe Bool
    Maybe Legend
    Maybe DispBlanksAs
    Maybe ChartTitle
    _chspTitle :: ChartSpace -> Maybe ChartTitle
    _chspCharts :: ChartSpace -> [Chart]
    _chspLegend :: ChartSpace -> Maybe Legend
    _chspPlotVisOnly :: ChartSpace -> Maybe Bool
    _chspDispBlanksAs :: ChartSpace -> Maybe DispBlanksAs
    _chspTitle :: Maybe ChartTitle
    _chspCharts :: [Chart]
    _chspLegend :: Maybe Legend
    _chspPlotVisOnly :: Maybe Bool
    _chspDispBlanksAs :: Maybe DispBlanksAs
    ..} =
        Name -> [Element] -> Element
    elementListSimple Name
    nm [Element
    nonRounded, Element
    chartEl, Element
    chSpPr]
        where
          -- no such element gives a chart space with rounded corners
          nonRounded :: Element
    nonRounded = Name -> Bool -> Element
    forall a. ToAttrVal a => Name -> a -> Element
    elementValue Name
    "roundedCorners" Bool
    False
          chSpPr :: Element
    chSpPr = Name -> ShapeProperties -> Element
    forall a. ToElement a => Name -> a -> Element
    toElement Name
    "spPr" (ShapeProperties -> Element) -> ShapeProperties -> Element
    forall a b. (a -> b) -> a -> b
    $ ShapeProperties
    forall a. Default a => a
    def {_spFill = Just $ solidRgb "ffffff"}
          chartEl :: Element
    chartEl = Name -> [Element] -> Element
    elementListSimple Name
    "chart" [Element]
    elements
          elements :: [Element]
    elements =
            [Maybe Element] -> [Element]
    forall a. [Maybe a] -> [a]
    catMaybes
              [ Name -> ChartTitle -> Element
    forall a. ToElement a => Name -> a -> Element
    toElement Name
    "title" (ChartTitle -> Element) -> Maybe ChartTitle -> Maybe Element
    forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
    <$> Maybe ChartTitle
    _chspTitle
              -- LO?
              , Element -> Maybe Element
    forall a. a -> Maybe a
    Just (Element -> Maybe Element) -> Element -> Maybe Element
    forall a b. (a -> b) -> a -> b
    $ Name -> Bool -> Element
    forall a. ToAttrVal a => Name -> a -> Element
    elementValue Name
    "autoTitleDeleted" Bool
    False
              , Element -> Maybe Element
    forall a. a -> Maybe a
    Just (Element -> Maybe Element) -> Element -> Maybe Element
    forall a b. (a -> b) -> a -> b
    $ Name -> [Element] -> Element
    elementListSimple Name
    "plotArea" [Element]
    areaEls
              , Name -> Legend -> Element
    forall a. ToElement a => Name -> a -> Element
    toElement Name
    "legend" (Legend -> Element) -> Maybe Legend -> Maybe Element
    forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
    <$> Maybe Legend
    _chspLegend
              , Name -> Bool -> Element
    forall a. ToAttrVal a => Name -> a -> Element
    elementValue Name
    "plotVisOnly" (Bool -> Element) -> Maybe Bool -> Maybe Element
    forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
    <$> Maybe Bool
    _chspPlotVisOnly
              , Name -> DispBlanksAs -> Element
    forall a. ToAttrVal a => Name -> a -> Element
    elementValue Name
    "dispBlanksAs" (DispBlanksAs -> Element) -> Maybe DispBlanksAs -> Maybe Element
    forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
    <$> Maybe DispBlanksAs
    _chspDispBlanksAs
              ]
          areaEls :: [Element]
    areaEls = [Element]
    charts [Element] -> [Element] -> [Element]
    forall a. [a] -> [a] -> [a]
    ++ [Element]
    axes
          (Int
    _, [Element]
    charts, [Element]
    axes) = (Chart
     -> (Int, [Element], [Element]) -> (Int, [Element], [Element]))
    -> (Int, [Element], [Element])
    -> [Chart]
    -> (Int, [Element], [Element])
    forall a b. (a -> b -> b) -> b -> [a] -> b
    forall (t :: * -> *) a b.
    Foldable t =>
    (a -> b -> b) -> b -> t a -> b
    foldr Chart -> (Int, [Element], [Element]) -> (Int, [Element], [Element])
    addChart (Int
    1, [], []) [Chart]
    _chspCharts
          addChart :: Chart -> (Int, [Element], [Element]) -> (Int, [Element], [Element])
    addChart Chart
    ch (Int
    i, [Element]
    cs, [Element]
    as) =
            let (Element
    c, [Element]
    as') = Chart -> Int -> (Element, [Element])
    chartToElements Chart
    ch Int
    i
            in (Int
    i Int -> Int -> Int
    forall a. Num a => a -> a -> a
    + [Element] -> Int
    forall a. [a] -> Int
    forall (t :: * -> *) a. Foldable t => t a -> Int
    length [Element]
    as', Element
    c Element -> [Element] -> [Element]
    forall a. a -> [a] -> [a]
    : [Element]
    cs, [Element]
    as' [Element] -> [Element] -> [Element]
    forall a. [a] -> [a] -> [a]
    ++ [Element]
    as)

    chartToElements :: Chart -> Int -> (Element, [Element])
    chartToElements :: Chart -> Int -> (Element, [Element])
    chartToElements Chart
    chart Int
    axId =
      case Chart
    chart of
        LineChart {[LineSeries]
    Maybe Bool
    ChartGrouping
    _lnchGrouping :: Chart -> ChartGrouping
    _lnchSeries :: Chart -> [LineSeries]
    _lnchMarker :: Chart -> Maybe Bool
    _lnchSmooth :: Chart -> Maybe Bool
    _lnchGrouping :: ChartGrouping
    _lnchSeries :: [LineSeries]
    _lnchMarker :: Maybe Bool
    _lnchSmooth :: Maybe Bool
    ..} ->
          Name
    -> [Element]
    -> Maybe ChartGrouping
    -> [LineSeries]
    -> [Element]
    -> [Element]
    -> (Element, [Element])
    forall s gr.
    (ToElement s, ToAttrVal gr) =>
    Name
    -> [Element]
    -> Maybe gr
    -> [s]
    -> [Element]
    -> [Element]
    -> (Element, [Element])
    chartElement
            Name
    "lineChart"
            [Element]
    stdAxes
            (ChartGrouping -> Maybe ChartGrouping
    forall a. a -> Maybe a
    Just ChartGrouping
    _lnchGrouping)
            [LineSeries]
    _lnchSeries
            []
            ([Maybe Element] -> [Element]
    forall a. [Maybe a] -> [a]
    catMaybes
               [ Name -> Bool -> Element
    forall a. ToAttrVal a => Name -> a -> Element
    elementValue Name
    "marker" (Bool -> Element) -> Maybe Bool -> Maybe Element
    forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
    <$> Maybe Bool
    _lnchMarker
               , Name -> Bool -> Element
    forall a. ToAttrVal a => Name -> a -> Element
    elementValue Name
    "smooth" (Bool -> Element) -> Maybe Bool -> Maybe Element
    forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
    <$> Maybe Bool
    _lnchSmooth
               ])
        AreaChart {[AreaSeries]
    Maybe ChartGrouping
    _archGrouping :: Chart -> Maybe ChartGrouping
    _archSeries :: Chart -> [AreaSeries]
    _archGrouping :: Maybe ChartGrouping
    _archSeries :: [AreaSeries]
    ..} ->
          Name
    -> [Element]
    -> Maybe ChartGrouping
    -> [AreaSeries]
    -> [Element]
    -> [Element]
    -> (Element, [Element])
    forall s gr.
    (ToElement s, ToAttrVal gr) =>
    Name
    -> [Element]
    -> Maybe gr
    -> [s]
    -> [Element]
    -> [Element]
    -> (Element, [Element])
    chartElement Name
    "areaChart" [Element]
    stdAxes Maybe ChartGrouping
    _archGrouping [AreaSeries]
    _archSeries [] []
        BarChart {[BarSeries]
    Maybe BarChartGrouping
    BarDirection
    _brchDirection :: Chart -> BarDirection
    _brchGrouping :: Chart -> Maybe BarChartGrouping
    _brchSeries :: Chart -> [BarSeries]
    _brchDirection :: BarDirection
    _brchGrouping :: Maybe BarChartGrouping
    _brchSeries :: [BarSeries]
    ..} ->
          Name
    -> [Element]
    -> Maybe BarChartGrouping
    -> [BarSeries]
    -> [Element]
    -> [Element]
    -> (Element, [Element])
    forall s gr.
    (ToElement s, ToAttrVal gr) =>
    Name
    -> [Element]
    -> Maybe gr
    -> [s]
    -> [Element]
    -> [Element]
    -> (Element, [Element])
    chartElement
            Name
    "barChart"
            [Element]
    stdAxes
            Maybe BarChartGrouping
    _brchGrouping
            [BarSeries]
    _brchSeries
            [Name -> BarDirection -> Element
    forall a. ToAttrVal a => Name -> a -> Element
    elementValue Name
    "barDir" BarDirection
    _brchDirection]
            []
        PieChart {[PieSeries]
    _pichSeries :: Chart -> [PieSeries]
    _pichSeries :: [PieSeries]
    ..} -> Name
    -> [Element]
    -> Maybe ChartGrouping
    -> [PieSeries]
    -> [Element]
    -> [Element]
    -> (Element, [Element])
    forall s gr.
    (ToElement s, ToAttrVal gr) =>
    Name
    -> [Element]
    -> Maybe gr
    -> [s]
    -> [Element]
    -> [Element]
    -> (Element, [Element])
    chartElement Name
    "pieChart" [] Maybe ChartGrouping
    noGrouping [PieSeries]
    _pichSeries [] []
        ScatterChart {[ScatterSeries]
    ScatterStyle
    _scchStyle :: Chart -> ScatterStyle
    _scchSeries :: Chart -> [ScatterSeries]
    _scchStyle :: ScatterStyle
    _scchSeries :: [ScatterSeries]
    ..} ->
          Name
    -> [Element]
    -> Maybe ChartGrouping
    -> [ScatterSeries]
    -> [Element]
    -> [Element]
    -> (Element, [Element])
    forall s gr.
    (ToElement s, ToAttrVal gr) =>
    Name
    -> [Element]
    -> Maybe gr
    -> [s]
    -> [Element]
    -> [Element]
    -> (Element, [Element])
    chartElement
            Name
    "scatterChart"
            [Element]
    xyAxes
            Maybe ChartGrouping
    noGrouping
            [ScatterSeries]
    _scchSeries
            [Name -> ScatterStyle -> Element
    forall a. ToAttrVal a => Name -> a -> Element
    elementValue Name
    "scatterStyle" ScatterStyle
    _scchStyle]
            []
      where
        noGrouping :: Maybe ChartGrouping
        noGrouping :: Maybe ChartGrouping
    noGrouping = Maybe ChartGrouping
    forall a. Maybe a
    Nothing
        chartElement
          :: (ToElement s, ToAttrVal gr)
          => Name
          -> [Element]
          -> Maybe gr
          -> [s]
          -> [Element]
          -> [Element]
          -> (Element, [Element])
        chartElement :: forall s gr.
    (ToElement s, ToAttrVal gr) =>
    Name
    -> [Element]
    -> Maybe gr
    -> [s]
    -> [Element]
    -> [Element]
    -> (Element, [Element])
    chartElement Name
    nm [Element]
    axes Maybe gr
    mGrouping [s]
    series [Element]
    prepended [Element]
    appended =
          ( Name -> [Element] -> Element
    elementListSimple Name
    nm ([Element] -> Element) -> [Element] -> Element
    forall a b. (a -> b) -> a -> b
    $
            [Element]
    prepended [Element] -> [Element] -> [Element]
    forall a. [a] -> [a] -> [a]
    ++
            (Maybe Element -> [Element]
    forall a. Maybe a -> [a]
    maybeToList (Maybe Element -> [Element]) -> Maybe Element -> [Element]
    forall a b. (a -> b) -> a -> b
    $ Name -> gr -> Element
    forall a. ToAttrVal a => Name -> a -> Element
    elementValue Name
    "grouping" (gr -> Element) -> Maybe gr -> Maybe Element
    forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
    <$> Maybe gr
    mGrouping) [Element] -> [Element] -> [Element]
    forall a. [a] -> [a] -> [a]
    ++
            (Element
    varyColors Element -> [Element] -> [Element]
    forall a. a -> [a] -> [a]
    : [s] -> [Element]
    forall {a}. ToElement a => [a] -> [Element]
    seriesEls [s]
    series) [Element] -> [Element] -> [Element]
    forall a. [a] -> [a] -> [a]
    ++
            [Element]
    appended [Element] -> [Element] -> [Element]
    forall a. [a] -> [a] -> [a]
    ++ (Int -> Element -> Element) -> [Int] -> [Element] -> [Element]
    forall a b c. (a -> b -> c) -> [a] -> [b] -> [c]
    zipWith (\Int
    n Element
    _ -> Name -> Int -> Element
    forall a. ToAttrVal a => Name -> a -> Element
    elementValue Name
    "axId" Int
    n) [Int
    axId ..] [Element]
    axes
          , [Element]
    axes)
        -- no element seems to be equal to varyColors=true in Excel Online
        varyColors :: Element
    varyColors = Name -> Bool -> Element
    forall a. ToAttrVal a => Name -> a -> Element
    elementValue Name
    "varyColors" Bool
    False
        seriesEls :: [a] -> [Element]
    seriesEls [a]
    series = [Int -> a -> Element
    forall a. ToElement a => Int -> a -> Element
    indexedSeriesEl Int
    i a
    s | (Int
    i, a
    s) <- [Int] -> [a] -> [(Int, a)]
    forall a b. [a] -> [b] -> [(a, b)]
    zip [Int
    0 ..] [a]
    series]
        indexedSeriesEl
          :: ToElement a
          => Int -> a -> Element
        indexedSeriesEl :: forall a. ToElement a => Int -> a -> Element
    indexedSeriesEl Int
    i a
    s = Int -> Element -> Element
    forall {a}. ToAttrVal a => a -> Element -> Element
    prependI Int
    i (Element -> Element) -> Element -> Element
    forall a b. (a -> b) -> a -> b
    $ Name -> a -> Element
    forall a. ToElement a => Name -> a -> Element
    toElement Name
    "ser" a
    s
        prependI :: a -> Element -> Element
    prependI a
    i e :: Element
    e@Element {[Node]
    Map Name Text
    Name
    elementName :: Name
    elementAttributes :: Map Name Text
    elementNodes :: [Node]
    elementName :: Element -> Name
    elementAttributes :: Element -> Map Name Text
    elementNodes :: Element -> [Node]
    ..} = Element
    e {elementNodes = iNodes i ++ elementNodes}
        iNodes :: a -> [Node]
    iNodes a
    i = (Element -> Node) -> [Element] -> [Node]
    forall a b. (a -> b) -> [a] -> [b]
    map Element -> Node
    NodeElement [Name -> a -> Element
    forall a. ToAttrVal a => Name -> a -> Element
    elementValue Name
    n a
    i | Name
    n <- [Name
    "idx", Name
    "order"]]

        stdAxes :: [Element]
    stdAxes = [Int -> Int -> Element
    catAx Int
    axId (Int
    axId Int -> Int -> Int
    forall a. Num a => a -> a -> a
    + Int
    1), Text -> Int -> Int -> Element
    valAx Text
    "l" (Int
    axId Int -> Int -> Int
    forall a. Num a => a -> a -> a
    + Int
    1) Int
    axId]
        xyAxes :: [Element]
    xyAxes = [Text -> Int -> Int -> Element
    valAx Text
    "b" Int
    axId (Int
    axId Int -> Int -> Int
    forall a. Num a => a -> a -> a
    + Int
    1), Text -> Int -> Int -> Element
    valAx Text
    "l" (Int
    axId Int -> Int -> Int
    forall a. Num a => a -> a -> a
    + Int
    1) Int
    axId]
        catAx :: Int -> Int -> Element
        catAx :: Int -> Int -> Element
    catAx Int
    i Int
    cr =
          Name -> [Element] -> Element
    elementListSimple Name
    "catAx" ([Element] -> Element) -> [Element] -> Element
    forall a b. (a -> b) -> a -> b
    $
          [ Name -> Int -> Element
    forall a. ToAttrVal a => Name -> a -> Element
    elementValue Name
    "axId" Int
    i
          , Name -> Element
    emptyElement Name
    "scaling"
          , Name -> Bool -> Element
    forall a. ToAttrVal a => Name -> a -> Element
    elementValue Name
    "delete" Bool
    False
          , Name -> Text -> Element
    forall a. ToAttrVal a => Name -> a -> Element
    elementValue Name
    "axPos" (Text
    "b" :: Text)
          , Name -> TickMark -> Element
    forall a. ToAttrVal a => Name -> a -> Element
    elementValue Name
    "majorTickMark" TickMark
    TickMarkNone
          , Name -> TickMark -> Element
    forall a. ToAttrVal a => Name -> a -> Element
    elementValue Name
    "minorTickMark" TickMark
    TickMarkNone
          , Name -> ShapeProperties -> Element
    forall a. ToElement a => Name -> a -> Element
    toElement Name
    "spPr" ShapeProperties
    grayLines
          , Name -> Int -> Element
    forall a. ToAttrVal a => Name -> a -> Element
    elementValue Name
    "crossAx" Int
    cr
          , Name -> Bool -> Element
    forall a. ToAttrVal a => Name -> a -> Element
    elementValue Name
    "auto" Bool
    True
          ]
        valAx :: Text -> Int -> Int -> Element
        valAx :: Text -> Int -> Int -> Element
    valAx Text
    pos Int
    i Int
    cr =
          Name -> [Element] -> Element
    elementListSimple Name
    "valAx" ([Element] -> Element) -> [Element] -> Element
    forall a b. (a -> b) -> a -> b
    $
          [ Name -> Int -> Element
    forall a. ToAttrVal a => Name -> a -> Element
    elementValue Name
    "axId" Int
    i
          , Name -> Element
    emptyElement Name
    "scaling"
          , Name -> Bool -> Element
    forall a. ToAttrVal a => Name -> a -> Element
    elementValue Name
    "delete" Bool
    False
          , Name -> Text -> Element
    forall a. ToAttrVal a => Name -> a -> Element
    elementValue Name
    "axPos" Text
    pos
          , Element
    gridLinesEl
          , Name -> TickMark -> Element
    forall a. ToAttrVal a => Name -> a -> Element
    elementValue Name
    "majorTickMark" TickMark
    TickMarkNone
          , Name -> TickMark -> Element
    forall a. ToAttrVal a => Name -> a -> Element
    elementValue Name
    "minorTickMark" TickMark
    TickMarkNone
          , Name -> ShapeProperties -> Element
    forall a. ToElement a => Name -> a -> Element
    toElement Name
    "spPr" ShapeProperties
    grayLines
          , Name -> Int -> Element
    forall a. ToAttrVal a => Name -> a -> Element
    elementValue Name
    "crossAx" Int
    cr
          ]
        grayLines :: ShapeProperties
    grayLines = ShapeProperties
    forall a. Default a => a
    def {_spOutline = Just def {_lnFill = Just $ solidRgb "b3b3b3"}}
        gridLinesEl :: Element
    gridLinesEl =
          Name -> [Element] -> Element
    elementListSimple Name
    "majorGridlines" [Name -> ShapeProperties -> Element
    forall a. ToElement a => Name -> a -> Element
    toElement Name
    "spPr" ShapeProperties
    grayLines]

    instance ToAttrVal ChartGrouping where
      toAttrVal :: ChartGrouping -> Text
    toAttrVal ChartGrouping
    PercentStackedGrouping = Text
    "percentStacked"
      toAttrVal ChartGrouping
    StandardGrouping = Text
    "standard"
      toAttrVal ChartGrouping
    StackedGrouping = Text
    "stacked"

    instance ToAttrVal BarChartGrouping where
      toAttrVal :: BarChartGrouping -> Text
    toAttrVal BarChartGrouping
    BarClusteredGrouping = Text
    "clustered"
      toAttrVal BarChartGrouping
    BarPercentStackedGrouping = Text
    "percentStacked"
      toAttrVal BarChartGrouping
    BarStandardGrouping = Text
    "standard"
      toAttrVal BarChartGrouping
    BarStackedGrouping = Text
    "stacked"

    instance ToAttrVal BarDirection where
      toAttrVal :: BarDirection -> Text
    toAttrVal BarDirection
    DirectionBar = Text
    "bar"
      toAttrVal BarDirection
    DirectionColumn = Text
    "col"

    instance ToAttrVal ScatterStyle where
      toAttrVal :: ScatterStyle -> Text
    toAttrVal ScatterStyle
    ScatterNone = Text
    "none"
      toAttrVal ScatterStyle
    ScatterLine = Text
    "line"
      toAttrVal ScatterStyle
    ScatterLineMarker = Text
    "lineMarker"
      toAttrVal ScatterStyle
    ScatterMarker = Text
    "marker"
      toAttrVal ScatterStyle
    ScatterSmooth = Text
    "smooth"
      toAttrVal ScatterStyle
    ScatterSmoothMarker = Text
    "smoothMarker"

    instance ToElement LineSeries where
      toElement :: Name -> LineSeries -> Element
    toElement Name
    nm LineSeries {Maybe Bool
    Maybe Formula
    Maybe DataLblProps
    Maybe DataMarker
    Series
    _lnserShared :: LineSeries -> Series
    _lnserMarker :: LineSeries -> Maybe DataMarker
    _lnserDataLblProps :: LineSeries -> Maybe DataLblProps
    _lnserVal :: LineSeries -> Maybe Formula
    _lnserSmooth :: LineSeries -> Maybe Bool
    _lnserShared :: Series
    _lnserMarker :: Maybe DataMarker
    _lnserDataLblProps :: Maybe DataLblProps
    _lnserVal :: Maybe Formula
    _lnserSmooth :: Maybe Bool
    ..} = Name
    -> Series -> Maybe Formula -> [Element] -> [Element] -> Element
    simpleSeries Name
    nm Series
    _lnserShared Maybe Formula
    _lnserVal [Element]
    pr [Element]
    ap
        where
          pr :: [Element]
    pr =
            [Maybe Element] -> [Element]
    forall a. [Maybe a] -> [a]
    catMaybes
              [ Name -> DataMarker -> Element
    forall a. ToElement a => Name -> a -> Element
    toElement Name
    "marker" (DataMarker -> Element) -> Maybe DataMarker -> Maybe Element
    forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
    <$> Maybe DataMarker
    _lnserMarker
              , Name -> DataLblProps -> Element
    forall a. ToElement a => Name -> a -> Element
    toElement Name
    "dLbls" (DataLblProps -> Element) -> Maybe DataLblProps -> Maybe Element
    forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
    <$> Maybe DataLblProps
    _lnserDataLblProps
              ]
          ap :: [Element]
    ap = Maybe Element -> [Element]
    forall a. Maybe a -> [a]
    maybeToList (Maybe Element -> [Element]) -> Maybe Element -> [Element]
    forall a b. (a -> b) -> a -> b
    $ Name -> Bool -> Element
    forall a. ToAttrVal a => Name -> a -> Element
    elementValue Name
    "smooth" (Bool -> Element) -> Maybe Bool -> Maybe Element
    forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
    <$> Maybe Bool
    _lnserSmooth

    simpleSeries :: Name
                 -> Series
                 -> Maybe Formula
                 -> [Element]
                 -> [Element]
                 -> Element
    simpleSeries :: Name
    -> Series -> Maybe Formula -> [Element] -> [Element] -> Element
    simpleSeries Name
    nm Series
    shared Maybe Formula
    val [Element]
    prepended [Element]
    appended =
      Element
    serEl {elementNodes = elementNodes serEl ++ map NodeElement elements}
      where
        serEl :: Element
    serEl = Name -> Series -> Element
    forall a. ToElement a => Name -> a -> Element
    toElement Name
    nm Series
    shared
        elements :: [Element]
    elements = [Element]
    prepended [Element] -> [Element] -> [Element]
    forall a. [a] -> [a] -> [a]
    ++ (Maybe Formula -> Element
    forall {a}. ToElement a => Maybe a -> Element
    valEl Maybe Formula
    val Element -> [Element] -> [Element]
    forall a. a -> [a] -> [a]
    : [Element]
    appended)
        valEl :: Maybe a -> Element
    valEl Maybe a
    v =
          Name -> [Element] -> Element
    elementListSimple
            Name
    "val"
            [Name -> [Element] -> Element
    elementListSimple Name
    "numRef" ([Element] -> Element) -> [Element] -> Element
    forall a b. (a -> b) -> a -> b
    $ Maybe Element -> [Element]
    forall a. Maybe a -> [a]
    maybeToList (Name -> a -> Element
    forall a. ToElement a => Name -> a -> Element
    toElement Name
    "f" (a -> Element) -> Maybe a -> Maybe Element
    forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
    <$> Maybe a
    v)]

    instance ToElement DataMarker where
      toElement :: Name -> DataMarker -> Element
    toElement Name
    nm DataMarker {Maybe Int
    Maybe DataMarkerSymbol
    _dmrkSymbol :: DataMarker -> Maybe DataMarkerSymbol
    _dmrkSize :: DataMarker -> Maybe Int
    _dmrkSymbol :: Maybe DataMarkerSymbol
    _dmrkSize :: Maybe Int
    ..} = Name -> [Element] -> Element
    elementListSimple Name
    nm [Element]
    elements
        where
          elements :: [Element]
    elements =
            [Maybe Element] -> [Element]
    forall a. [Maybe a] -> [a]
    catMaybes
              [ Name -> DataMarkerSymbol -> Element
    forall a. ToAttrVal a => Name -> a -> Element
    elementValue Name
    "symbol" (DataMarkerSymbol -> Element)
    -> Maybe DataMarkerSymbol -> Maybe Element
    forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
    <$> Maybe DataMarkerSymbol
    _dmrkSymbol
              , Name -> Int -> Element
    forall a. ToAttrVal a => Name -> a -> Element
    elementValue Name
    "size" (Int -> Element) -> Maybe Int -> Maybe Element
    forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
    <$> Maybe Int
    _dmrkSize
              ]

    instance ToAttrVal DataMarkerSymbol where
      toAttrVal :: DataMarkerSymbol -> Text
    toAttrVal DataMarkerSymbol
    DataMarkerCircle = Text
    "circle"
      toAttrVal DataMarkerSymbol
    DataMarkerDash = Text
    "dash"
      toAttrVal DataMarkerSymbol
    DataMarkerDiamond = Text
    "diamond"
      toAttrVal DataMarkerSymbol
    DataMarkerDot = Text
    "dot"
      toAttrVal DataMarkerSymbol
    DataMarkerNone = Text
    "none"
      toAttrVal DataMarkerSymbol
    DataMarkerPicture = Text
    "picture"
      toAttrVal DataMarkerSymbol
    DataMarkerPlus = Text
    "plus"
      toAttrVal DataMarkerSymbol
    DataMarkerSquare = Text
    "square"
      toAttrVal DataMarkerSymbol
    DataMarkerStar = Text
    "star"
      toAttrVal DataMarkerSymbol
    DataMarkerTriangle = Text
    "triangle"
      toAttrVal DataMarkerSymbol
    DataMarkerX = Text
    "x"
      toAttrVal DataMarkerSymbol
    DataMarkerAuto = Text
    "auto"

    instance ToElement DataLblProps where
      toElement :: Name -> DataLblProps -> Element
    toElement Name
    nm DataLblProps {Maybe Bool
    _dlblShowLegendKey :: DataLblProps -> Maybe Bool
    _dlblShowVal :: DataLblProps -> Maybe Bool
    _dlblShowCatName :: DataLblProps -> Maybe Bool
    _dlblShowSerName :: DataLblProps -> Maybe Bool
    _dlblShowPercent :: DataLblProps -> Maybe Bool
    _dlblShowLegendKey :: Maybe Bool
    _dlblShowVal :: Maybe Bool
    _dlblShowCatName :: Maybe Bool
    _dlblShowSerName :: Maybe Bool
    _dlblShowPercent :: Maybe Bool
    ..} = Name -> [Element] -> Element
    elementListSimple Name
    nm [Element]
    elements
        where
          elements :: [Element]
    elements =
            [Maybe Element] -> [Element]
    forall a. [Maybe a] -> [a]
    catMaybes
              [ Name -> Bool -> Element
    forall a. ToAttrVal a => Name -> a -> Element
    elementValue Name
    "showLegendKey" (Bool -> Element) -> Maybe Bool -> Maybe Element
    forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
    <$> Maybe Bool
    _dlblShowLegendKey
              , Name -> Bool -> Element
    forall a. ToAttrVal a => Name -> a -> Element
    elementValue Name
    "showVal" (Bool -> Element) -> Maybe Bool -> Maybe Element
    forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
    <$> Maybe Bool
    _dlblShowVal
              , Name -> Bool -> Element
    forall a. ToAttrVal a => Name -> a -> Element
    elementValue Name
    "showCatName" (Bool -> Element) -> Maybe Bool -> Maybe Element
    forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
    <$> Maybe Bool
    _dlblShowCatName
              , Name -> Bool -> Element
    forall a. ToAttrVal a => Name -> a -> Element
    elementValue Name
    "showSerName" (Bool -> Element) -> Maybe Bool -> Maybe Element
    forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
    <$> Maybe Bool
    _dlblShowSerName
              , Name -> Bool -> Element
    forall a. ToAttrVal a => Name -> a -> Element
    elementValue Name
    "showPercent" (Bool -> Element) -> Maybe Bool -> Maybe Element
    forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
    <$> Maybe Bool
    _dlblShowPercent
              ]

    instance ToElement AreaSeries where
      toElement :: Name -> AreaSeries -> Element
    toElement Name
    nm AreaSeries {Maybe Formula
    Maybe DataLblProps
    Series
    _arserShared :: AreaSeries -> Series
    _arserDataLblProps :: AreaSeries -> Maybe DataLblProps
    _arserVal :: AreaSeries -> Maybe Formula
    _arserShared :: Series
    _arserDataLblProps :: Maybe DataLblProps
    _arserVal :: Maybe Formula
    ..} = Name
    -> Series -> Maybe Formula -> [Element] -> [Element] -> Element
    simpleSeries Name
    nm Series
    _arserShared Maybe Formula
    _arserVal [Element]
    pr []
        where
          pr :: [Element]
    pr = Maybe Element -> [Element]
    forall a. Maybe a -> [a]
    maybeToList (Maybe Element -> [Element]) -> Maybe Element -> [Element]
    forall a b. (a -> b) -> a -> b
    $ (DataLblProps -> Element) -> Maybe DataLblProps -> Maybe Element
    forall a b. (a -> b) -> Maybe a -> Maybe b
    forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
    fmap (Name -> DataLblProps -> Element
    forall a. ToElement a => Name -> a -> Element
    toElement Name
    "dLbls") Maybe DataLblProps
    _arserDataLblProps

    instance ToElement BarSeries where
      toElement :: Name -> BarSeries -> Element
    toElement Name
    nm BarSeries {Maybe Formula
    Maybe DataLblProps
    Series
    _brserShared :: BarSeries -> Series
    _brserDataLblProps :: BarSeries -> Maybe DataLblProps
    _brserVal :: BarSeries -> Maybe Formula
    _brserShared :: Series
    _brserDataLblProps :: Maybe DataLblProps
    _brserVal :: Maybe Formula
    ..} = Name
    -> Series -> Maybe Formula -> [Element] -> [Element] -> Element
    simpleSeries Name
    nm Series
    _brserShared Maybe Formula
    _brserVal [Element]
    pr []
        where
          pr :: [Element]
    pr = Maybe Element -> [Element]
    forall a. Maybe a -> [a]
    maybeToList (Maybe Element -> [Element]) -> Maybe Element -> [Element]
    forall a b. (a -> b) -> a -> b
    $ (DataLblProps -> Element) -> Maybe DataLblProps -> Maybe Element
    forall a b. (a -> b) -> Maybe a -> Maybe b
    forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
    fmap (Name -> DataLblProps -> Element
    forall a. ToElement a => Name -> a -> Element
    toElement Name
    "dLbls") Maybe DataLblProps
    _brserDataLblProps

    instance ToElement PieSeries where
      toElement :: Name -> PieSeries -> Element
    toElement Name
    nm PieSeries {[DataPoint]
    Maybe Formula
    Maybe DataLblProps
    Series
    _piserShared :: PieSeries -> Series
    _piserDataPoints :: PieSeries -> [DataPoint]
    _piserDataLblProps :: PieSeries -> Maybe DataLblProps
    _piserVal :: PieSeries -> Maybe Formula
    _piserShared :: Series
    _piserDataPoints :: [DataPoint]
    _piserDataLblProps :: Maybe DataLblProps
    _piserVal :: Maybe Formula
    ..} = Name
    -> Series -> Maybe Formula -> [Element] -> [Element] -> Element
    simpleSeries Name
    nm Series
    _piserShared Maybe Formula
    _piserVal [Element]
    pr []
        where
          pr :: [Element]
    pr = [Element]
    dPts [Element] -> [Element] -> [Element]
    forall a. [a] -> [a] -> [a]
    ++ Maybe Element -> [Element]
    forall a. Maybe a -> [a]
    maybeToList ((DataLblProps -> Element) -> Maybe DataLblProps -> Maybe Element
    forall a b. (a -> b) -> Maybe a -> Maybe b
    forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
    fmap (Name -> DataLblProps -> Element
    forall a. ToElement a => Name -> a -> Element
    toElement Name
    "dLbls") Maybe DataLblProps
    _piserDataLblProps)
          dPts :: [Element]
    dPts = (Int -> DataPoint -> Element) -> [Int] -> [DataPoint] -> [Element]
    forall a b c. (a -> b -> c) -> [a] -> [b] -> [c]
    zipWith Int -> DataPoint -> Element
    forall {a}. ToAttrVal a => a -> DataPoint -> Element
    dPtEl [(Int
    0 :: Int) ..] [DataPoint]
    _piserDataPoints
          dPtEl :: a -> DataPoint -> Element
    dPtEl a
    i DataPoint {Maybe ShapeProperties
    Maybe DataMarker
    _dpMarker :: DataPoint -> Maybe DataMarker
    _dpShapeProperties :: DataPoint -> Maybe ShapeProperties
    _dpMarker :: Maybe DataMarker
    _dpShapeProperties :: Maybe ShapeProperties
    ..} =
            Name -> [Element] -> Element
    elementListSimple
              Name
    "dPt"
              (Name -> a -> Element
    forall a. ToAttrVal a => Name -> a -> Element
    elementValue Name
    "idx" a
    i Element -> [Element] -> [Element]
    forall a. a -> [a] -> [a]
    :
               [Maybe Element] -> [Element]
    forall a. [Maybe a] -> [a]
    catMaybes
                 [ Name -> DataMarker -> Element
    forall a. ToElement a => Name -> a -> Element
    toElement Name
    "marker" (DataMarker -> Element) -> Maybe DataMarker -> Maybe Element
    forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
    <$> Maybe DataMarker
    _dpMarker
                 , Name -> ShapeProperties -> Element
    forall a. ToElement a => Name -> a -> Element
    toElement Name
    "spPr" (ShapeProperties -> Element)
    -> Maybe ShapeProperties -> Maybe Element
    forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
    <$> Maybe ShapeProperties
    _dpShapeProperties
                 ])

    instance ToElement ScatterSeries where
      toElement :: Name -> ScatterSeries -> Element
    toElement Name
    nm ScatterSeries {Maybe Bool
    Maybe Formula
    Maybe DataLblProps
    Maybe DataMarker
    Series
    _scserShared :: ScatterSeries -> Series
    _scserMarker :: ScatterSeries -> Maybe DataMarker
    _scserDataLblProps :: ScatterSeries -> Maybe DataLblProps
    _scserXVal :: ScatterSeries -> Maybe Formula
    _scserYVal :: ScatterSeries -> Maybe Formula
    _scserSmooth :: ScatterSeries -> Maybe Bool
    _scserShared :: Series
    _scserMarker :: Maybe DataMarker
    _scserDataLblProps :: Maybe DataLblProps
    _scserXVal :: Maybe Formula
    _scserYVal :: Maybe Formula
    _scserSmooth :: Maybe Bool
    ..} =
        Element
    serEl {elementNodes = elementNodes serEl ++ map NodeElement elements}
        where
          serEl :: Element
    serEl = Name -> Series -> Element
    forall a. ToElement a => Name -> a -> Element
    toElement Name
    nm Series
    _scserShared
          elements :: [Element]
    elements =
            [Maybe Element] -> [Element]
    forall a. [Maybe a] -> [a]
    catMaybes
              [ Name -> DataMarker -> Element
    forall a. ToElement a => Name -> a -> Element
    toElement Name
    "marker" (DataMarker -> Element) -> Maybe DataMarker -> Maybe Element
    forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
    <$> Maybe DataMarker
    _scserMarker
              , Name -> DataLblProps -> Element
    forall a. ToElement a => Name -> a -> Element
    toElement Name
    "dLbls" (DataLblProps -> Element) -> Maybe DataLblProps -> Maybe Element
    forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
    <$> Maybe DataLblProps
    _scserDataLblProps
              ] [Element] -> [Element] -> [Element]
    forall a. [a] -> [a] -> [a]
    ++
            [Name -> Maybe Formula -> Element
    forall {a}. ToElement a => Name -> Maybe a -> Element
    valEl Name
    "xVal" Maybe Formula
    _scserXVal, Name -> Maybe Formula -> Element
    forall {a}. ToElement a => Name -> Maybe a -> Element
    valEl Name
    "yVal" Maybe Formula
    _scserYVal] [Element] -> [Element] -> [Element]
    forall a. [a] -> [a] -> [a]
    ++
            (Maybe Element -> [Element]
    forall a. Maybe a -> [a]
    maybeToList (Maybe Element -> [Element]) -> Maybe Element -> [Element]
    forall a b. (a -> b) -> a -> b
    $ (Bool -> Element) -> Maybe Bool -> Maybe Element
    forall a b. (a -> b) -> Maybe a -> Maybe b
    forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
    fmap (Name -> Bool -> Element
    forall a. ToAttrVal a => Name -> a -> Element
    elementValue Name
    "smooth") Maybe Bool
    _scserSmooth)
          valEl :: Name -> Maybe a -> Element
    valEl Name
    vnm Maybe a
    v =
            Name -> [Element] -> Element
    elementListSimple
              Name
    vnm
              [Name -> [Element] -> Element
    elementListSimple Name
    "numRef" ([Element] -> Element) -> [Element] -> Element
    forall a b. (a -> b) -> a -> b
    $ Maybe Element -> [Element]
    forall a. Maybe a -> [a]
    maybeToList (Name -> a -> Element
    forall a. ToElement a => Name -> a -> Element
    toElement Name
    "f" (a -> Element) -> Maybe a -> Maybe Element
    forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
    <$> Maybe a
    v)]

    -- should we respect idx and order?
    instance ToElement Series where
      toElement :: Name -> Series -> Element
    toElement Name
    nm Series {Maybe ShapeProperties
    Maybe Formula
    _serTx :: Series -> Maybe Formula
    _serShapeProperties :: Series -> Maybe ShapeProperties
    _serTx :: Maybe Formula
    _serShapeProperties :: Maybe ShapeProperties
    ..} =
        Name -> [Element] -> Element
    elementListSimple Name
    nm ([Element] -> Element) -> [Element] -> Element
    forall a b. (a -> b) -> a -> b
    $
        [ Name -> [Element] -> Element
    elementListSimple
            Name
    "tx"
            [Name -> [Element] -> Element
    elementListSimple Name
    "strRef" ([Element] -> Element) -> [Element] -> Element
    forall a b. (a -> b) -> a -> b
    $ Maybe Element -> [Element]
    forall a. Maybe a -> [a]
    maybeToList (Name -> Formula -> Element
    forall a. ToElement a => Name -> a -> Element
    toElement Name
    "f" (Formula -> Element) -> Maybe Formula -> Maybe Element
    forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
    <$> Maybe Formula
    _serTx)]
        ] [Element] -> [Element] -> [Element]
    forall a. [a] -> [a] -> [a]
    ++
        Maybe Element -> [Element]
    forall a. Maybe a -> [a]
    maybeToList (Name -> ShapeProperties -> Element
    forall a. ToElement a => Name -> a -> Element
    toElement Name
    "spPr" (ShapeProperties -> Element)
    -> Maybe ShapeProperties -> Maybe Element
    forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
    <$> Maybe ShapeProperties
    _serShapeProperties)

    instance ToElement ChartTitle where
      toElement :: Name -> ChartTitle -> Element
    toElement Name
    nm (ChartTitle Maybe TextBody
    body) =
        Name -> [Element] -> Element
    elementListSimple Name
    nm [Element
    txEl, Name -> Bool -> Element
    forall a. ToAttrVal a => Name -> a -> Element
    elementValue Name
    "overlay" Bool
    False]
        where
          txEl :: Element
    txEl = Name -> [Element] -> Element
    elementListSimple Name
    "tx" ([Element] -> Element) -> [Element] -> Element
    forall a b. (a -> b) -> a -> b
    $ [Maybe Element] -> [Element]
    forall a. [Maybe a] -> [a]
    catMaybes [Name -> TextBody -> Element
    forall a. ToElement a => Name -> a -> Element
    toElement (Text -> Name
    c_ Text
    "rich") (TextBody -> Element) -> Maybe TextBody -> Maybe Element
    forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
    <$> Maybe TextBody
    body]

    instance ToElement Legend where
      toElement :: Name -> Legend -> Element
    toElement Name
    nm Legend{Maybe Bool
    Maybe LegendPos
    _legendPos :: Legend -> Maybe LegendPos
    _legendOverlay :: Legend -> Maybe Bool
    _legendPos :: Maybe LegendPos
    _legendOverlay :: Maybe Bool
    ..} = Name -> [Element] -> Element
    elementListSimple Name
    nm [Element]
    elements
        where
           elements :: [Element]
    elements = [Maybe Element] -> [Element]
    forall a. [Maybe a] -> [a]
    catMaybes [ Name -> LegendPos -> Element
    forall a. ToAttrVal a => Name -> a -> Element
    elementValue Name
    "legendPos" (LegendPos -> Element) -> Maybe LegendPos -> Maybe Element
    forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
    <$> Maybe LegendPos
    _legendPos
                                , Name -> Bool -> Element
    forall a. ToAttrVal a => Name -> a -> Element
    elementValue Name
    "overlay" (Bool -> Element) -> Maybe Bool -> Maybe Element
    forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
    <$>Maybe Bool
    _legendOverlay]

    instance ToAttrVal LegendPos where
      toAttrVal :: LegendPos -> Text
    toAttrVal LegendPos
    LegendBottom   = Text
    "b"
      toAttrVal LegendPos
    LegendLeft     = Text
    "l"
      toAttrVal LegendPos
    LegendRight    = Text
    "r"
      toAttrVal LegendPos
    LegendTop      = Text
    "t"
      toAttrVal LegendPos
    LegendTopRight = Text
    "tr"

    instance ToAttrVal DispBlanksAs where
      toAttrVal :: DispBlanksAs -> Text
    toAttrVal DispBlanksAs
    DispBlanksAsGap  = Text
    "gap"
      toAttrVal DispBlanksAs
    DispBlanksAsSpan = Text
    "span"
      toAttrVal DispBlanksAs
    DispBlanksAsZero = Text
    "zero"

    instance ToAttrVal TickMark where
      toAttrVal :: TickMark -> Text
    toAttrVal TickMark
    TickMarkCross = Text
    "cross"
      toAttrVal TickMark
    TickMarkIn = Text
    "in"
      toAttrVal TickMark
    TickMarkNone = Text
    "none"
      toAttrVal TickMark
    TickMarkOut = Text
    "out"

    -- | Add chart namespace to name
    c_ :: Text -> Name
    c_ :: Text -> Name
    c_ Text
    x =
      Name {nameLocalName :: Text
    nameLocalName = Text
    x, nameNamespace :: Maybe Text
    nameNamespace = Text -> Maybe Text
    forall a. a -> Maybe a
    Just Text
    chartNs, namePrefix :: Maybe Text
    namePrefix = Text -> Maybe Text
    forall a. a -> Maybe a
    Just Text
    "c"}

    chartNs :: Text
    chartNs :: Text
    chartNs = Text
    "http://schemas.openxmlformats.org/drawingml/2006/chart"