This is my first time posting here, so if the post format is not good, I apologize and ask for guidance. I wrote the questions and uploaded the images to show the problem. If it is difficult to see them, please tell me.
I have a very beginner doubt, could anyone help me?
I’m trying to plot a stacked barchart from a pivot table.
I want to plot a stacked barchart from this pivot table, so the x-axis is the year, and the y-axis is the amount of sales by country. And I want the colors classified by country. If possible, I want to add my own colors.
The I did this. The y-axis didn’t accept y=‘country’ - the message error was ‘The dataframe contains no ‘country’.’. Then I added y=[‘Argentina’], and it worked somehow, plotting a stacked barchart.
It really all depends on your data, which chart to use, how to prepare the data (by sorting, grouping…). This makes it difficult to give you a general answer. Since you mentioned, you are just starting your plotly journey, I would recommend start building some basic charts and add complexity step by step. I think this would be a good starting point:
As for the format of your question keep in mind, that
posting your code as formatted code instead of images
adding (dummy) data to make it possible reproduce your problem
makes the lifes of the people willing to help you a lot easier.
Asking specific questions also increases the chances to get your questions answered.