Git Product home page Git Product logo

Comments (4)

mtennekes avatar mtennekes commented on September 1, 2024

I only see three categories of ShipMode:

> table(Sample_Superstore$ShipMode)
Delivery Truck    Express Air    Regular Air 
          1146            983           6270 

Notice that Tableau not only aggregates the tiles by SubCategory, but also by ShipMode itself (as main category). Without doing this, each subcategory is assigned to one (arbitrarily chosen) category.

This should work:

treemap(grouped,
        index=c("ShipMode", "SubCategory"),
        vSize="Total_Sales",
        vColor="ShipMode",
        type="categorical"
)

I'll have to fix the data.table warning though

from treemap.

fissehab avatar fissehab commented on September 1, 2024

Thanks for the prompt reply. I actually put a wrong link for the data.

This is the correct link and the "Ship Mode" has four categories: 'Second Class' 'Standard Class' 'First Class' 'Same Day'. However, the treemap shows only 'First Class' .
https://community.tableau.com/servlet/JiveServlet/download/351988-57774/Sample%20-%20Superstore.xls

from treemap.

mtennekes avatar mtennekes commented on September 1, 2024

My code also works for this one:

rplot

You can use fontsize.labels to omit the labels of ShipMode in the treemap itself.

from treemap.

fissehab avatar fissehab commented on September 1, 2024

Thank you! Is it possible to use a color palette in each category? I want the bigger rectangles to be deeper color. I mean one color palette in each category. I have data that has "failed" and "warning" categories and I want to use different color palettes for each one of them. I am looking for something like this:

image

from treemap.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.