Holger Schimanski Posted February 17, 2021 Share Posted February 17, 2021 For the categorical axis in Spotfire Mods I would like to know the Data fieldsit consist of. For a row I can retrieve the values of the categorical axis e.g. US >> B2B >> Car. I would like to know the data fields it is build from e.g. Country, Sales Type, Product. And also all a list of all possible values of this data field e.g. US, UK, DE, FI in their natural resp. default order. I don't know how to get such information from DataView or other Mods API. Link to comment Share on other sites More sharing options...
Magnus Rylander Posted February 22, 2021 Share Posted February 22, 2021 You can get the hierarchy information on the dataView using: dataView.categoricalAxis("name").hierarchy.levelsNote that since there can be any kind of transformation on a DataView's categorical axis through the expression, there is no clear connection between a column placed on an axis selector and the resulting categorical axis in the dataView. Link to comment Share on other sites More sharing options...
Holger Schimanski Posted February 22, 2021 Author Share Posted February 22, 2021 Great, this helps to get the e.g. County, Sales Type, Product. With this I can create a proper tooltip e.g. Country: US Sales Type: B2B Product: Car How about the County values in their natural order (independent from their order in the Rows) Link to comment Share on other sites More sharing options...
Magnus Rylander Posted February 23, 2021 Share Posted February 23, 2021 Here's an example of how the Area chart creates a tooltip string: https://github.com/TIBCOSoftware/spotfire-mods/blob/f1f9c8913f490ffab44f59cd2c414ece815f10a0/examples/js-areachart-d3/src/render.js#L656 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now