Shimoku docs

Line chart

The Line chart

Suppose you have continuous data that you would like to represent through a chart. A line chart is a good option. The line chart is especially effective when trying to identify a trend or pattern in your data, for example.

The method to use

The method is shimoku.plt.line()
It must contain the following input variables:
data: Union[str, DataFrame, List[Dict]]
x: str
y: List[str]
menu_path: str
order: int
Accepts the following input variables as optional:
title: Optional[str]
x_axis_name: Optional[str]
y_axis_name: Optional[str]
rows_size: Optional[int]
cols_size: Optional[int]
padding: Optional[List[int]]
And it may be personalized with the input variables:
option_modifications: Optional[Dict]


1. Default configuration

If the code runs with data, menu_path and axes configured as this:
data = [
{'date':, 1, 1), 'x': 5, 'y': 3},
{'date':, 1, 2), 'x': 5, 'y': 7},
{'date':, 1, 3), 'x': 4, 'y': 5},
{'date':, 1, 4), 'x': 7, 'y': 6},
{'date':, 1, 5), 'x': 3, 'y': 5},
x='date', y=['x', 'y'],
rows_size=2, cols_size=12,
The result is:
The line with the default configuration.

2. Title, axes names, legend and use of option_modifications, size and padding

It is possible to personalize the title of the chart, adding data points, name for each axis, the legend, size and space occupied. One example could be obtained using:
data = [
{'date':, 1, 1), 'new': 4, 'vac': 5},
{'date':, 1, 2), 'new': 7, 'vac': 6},
{'date':, 1, 3), 'new': 4, 'vac': 7},
{'date':, 1, 4), 'new': 9, 'vac': 8},
{'date':, 1, 5), 'new': 3, 'vac': 9},
{'date':, 1, 6), 'new': 6, 'vac': 2},
x='date', y=['new', 'vac'],
rows_size=2, cols_size=9,
title='Positive Results in the first six days - January',
option_modifications = {'dataZoom': False}
Set {'dataZoom': False} to remove the Zoom bar.
The result is:
Modifying data points, adding a title, legend, and other personalization. Note the space before the component using padding='0,0,0,2'.
Changing menu_path The menu_path can be modified.
It is possible to use any number of rows.