I have a dataframe called top_10 that looks like this:
7 DateTime_End Online_Sales_$_+ Online_Cancel_$_+ Online_THD_SKU+
8 2017-08-27 21.0 0.0 1000015555-SL LEM 32OZ
9 2018-01-07 33.0 4.0 1000015555-SL LEM 32OZ
10 2018-01-14 15.0 37.0 1000015555-SL LEM 32OZ
11 2018-01-21 8.0 28.0 1000015555-SL LEM 32OZ
12 2018-01-28 4.0 29.0 1000015555-SL LEM 32OZ
13 2018-02-04 9.0 43.0 1000017290-SG APC 640OZ
14 2018-02-11 212.91 9.0 1000017290-SG APC 640OZ
15 2018-02-18 0.0 11.0 1000017290-SG APC 640OZ
I am trying to create a line plot like the following using hvplot:
This is directly off HvPlot website
I am using the exact syntax as well:
top_10.hvplot(x='DateTime_End', y=["Online_Sales_$_+", "Online_Cancel_$_+"],
value_label="Sales")
But when I run it I get the following error:
ValueError: kdims argument expects a Dimension or list of dimensions,
specified as tuples, strings, dictionaries or Dimension instances, not a int type. Ensure you passed the data as the first argument.
After ensuring that this runs correctly I am also trying to add an argument for groupby='Online_THD_SKU+' so I can select the line charts for each SKU in the interactive plot.
Final code should look something like this:
top_10.hvplot(x='DateTime_End', y=['Online_Sales_$_+', 'Online_Cancel_$_+'],
value_label='Sales',groupby='Online_THD_SKU+', kind='line')
Any help would be greatly appreciated. I'm very new to hvplot. Thanks so much in advance!