Closed mwu-tow closed 5 years ago
Proposed docstring:
# Saves the chart to an image file.
#
# Image will have dimensions as requested in function arguments.
# The image file format is deduced from filename extension. Supported formats: eps, pdf, pgf, png, ps, raw, rgba, svg, svgz.
#
# > import Dataframes.Column
# > import Dataframes.Types
# > import Dataframes.Table
# >
# > def main:
# > l1 = [1,2,3,4,5]
# > l2 = [11,12,13,14,15]
# > col1 = Column.fromList "col1" Int64Type l1
# > col2 = Column.fromList "col2" Int64Type l2
# > table = Table.fromColumns [col1 , col2]
# > col = table.column "col1"
# > None
#
# errors:
# An exception is raised when output file is not writable.
# An exception is raised when output file extension is not of one of supported image formats.
# An exception is raised when requested image width or height is less or equal to zero.
#
# `width`: Requested width of the image, must be greater than zero.
# `height`: Requested height of the image, must be greater than zero.
# `filename`: Output path where image will be stored, must be writable.
#
# `return`: None
Two points however raise my concerns: 1) apparently we will have to repeat this for every single chart type 2) if so, the sample snippet should be different for each chart — but then we need to have a proper sampels for every one of them
Charts can now be saved to image files. Sample usage below: