superset icon indicating copy to clipboard operation
superset copied to clipboard

Pivot Table Conditional Formatting on Cells - Add Colour to Cells

Open DavidJHassan opened this issue 7 years ago • 28 comments

It would be nice if there was a way to add conditional formatting to individual cells to highlight them a certain color if the value in that cell is in or out of a range etc.

This was being worked on at some point in time on older versions of Superset. #3416

However, it looks like progress stopped. Can someone champion this feature and continue what was already done?

DavidJHassan avatar Sep 17 '19 13:09 DavidJHassan

Issue-Label Bot is automatically applying the label #enhancement to this issue, with a confidence of 0.80. Please mark this comment with :thumbsup: or :thumbsdown: to give our bot feedback!

Links: app homepage, dashboard and code for this bot.

issue-label-bot[bot] avatar Sep 17 '19 13:09 issue-label-bot[bot]

it s works for upto 0.34 version

kalimuthu123 avatar Sep 18 '19 06:09 kalimuthu123

How do I use it?

DavidJHassan avatar Sep 18 '19 13:09 DavidJHassan

Look the pull request for row and column configuration https://github.com/apache/incubator-superset/pull/4394

Its working fine in all versions upto the current versions

kalimuthu123 avatar Sep 19 '19 07:09 kalimuthu123

Need that ! :)

CoryChaplin avatar Sep 19 '19 15:09 CoryChaplin

Did this pull request ever make it into the official releases? Are we suppose to just take these extras file and add them to our config?

DavidJHassan avatar Sep 19 '19 16:09 DavidJHassan

yes row configuration was not merged yet ,u need to configure manually to get these options

kalimuthu123 avatar Sep 20 '19 08:09 kalimuthu123

The PR says that will not be merged as it is, it needs to be converted to a plugin before.

CoryChaplin avatar Sep 20 '19 09:09 CoryChaplin

Is someone able to convert these into a plugin? Does this PR help with this? #8222

DavidJHassan avatar Sep 21 '19 03:09 DavidJHassan

Look the pull request for row and column configuration #4394

Its working fine in all versions upto the current versions

I was looking into this PR and it's seen difficult to apply to the newer version of Superset. @kalimuthu123 do you know how to apply it to release 0.34? Any help will be welcome.

rc-ontruck avatar Nov 19 '19 15:11 rc-ontruck

i am intersted to add new features of grand total row and column here

kalimuthu123 avatar Nov 20 '19 07:11 kalimuthu123

@kalimuthu123 Have you tested this PR #4394 on versión 0.34? How do you do it? Best

rc-ontruck avatar Nov 20 '19 08:11 rc-ontruck

I expect the feature!

WChCh avatar Dec 11 '19 07:12 WChCh

i also worked column Grand Total feature in this table chart and we have used diferent formulas for the chart @WChCh

you may also use the different library for table chart visualisation such as webdatarocks(free edition), flexmoster(commercial)

https://www.webdatarocks.com/?r=wdr

it is an excel featured table chart it contains row grand total ,column grand total ,subtotal aggregate calculations in the chart.have a look into it u wll get ideas

kalimuthu123 avatar Dec 19 '19 14:12 kalimuthu123

@kalimuthu123 Have you tested this PR #4394 on versión 0.34? How do you do it? Best

hi all, not sure if this is still relevant but I was able to apply it into the current dev version 0.999 here is the fork: https://github.com/henry145145/incubator-superset/tree/develop (make sure pull the develop branch if you are going to clone it, the master branch is not update yet)

Most of the files from https://github.com/apache/incubator-superset/pull/4394/files can be found in the latest version except superset/assets/visualizations/pivot_table.js

I think the visualizations of the pivot table was converted to be a plugin and it was pointing from a node module library (ref: see https://github.com/apache/incubator-superset/pull/6838/files)

Inside superset/assets/node_modules/@superset-ui/legacy-plugin-chart-pivot-table, we will findPivotTable.js which is the new version of pivot_table.js.

However, I was not able to edit files in node_module.

Here is my attempt steps to solve this issue:

In dev version 0.999, superset/assets/src/visualizations/presets/MainPreset.js, it listed all the plugin and you will see

import PivotTableChartPlugin from '@superset-ui/legacy-plugin-chart-pivot-table

so instead of pointing from @superset-ui blah blah, we just need to make it point from a custom plugin folder

import PivotTableChartPlugin from '../PivotTable/PivotTableChartPlugin';

the custom plugin folder was under superset/assets/src/visualizations/. Currently filter box and time table is also from custom plugin folder. We will need to make a custom plugin folder call PivotTable which should look similar to superset/assets/node_modules/@superset-ui/legacy-plugin-chart-pivot-table.Then we can edit the PivotTable.js inside our custom folder

henry145145 avatar Jan 13 '20 22:01 henry145145

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. For admin, please label this issue .pinned to prevent stale bot from closing the issue.

stale[bot] avatar Mar 13 '20 23:03 stale[bot]

Hi, is there any news about implementation of this plugin? Thanks!

zufolo441 avatar May 19 '20 14:05 zufolo441

would be great if we had that... will help a lot.

dtaytson avatar May 26 '20 16:05 dtaytson

@henry145145, I am able to clone your forked repository and pivot table conditional formatting is working perfectly but it is not working on the latest code of superset. After your changes superset frontend code moved to different folder superset-frontend and other changes as well. Can you please suggest a way to apply your changes on the latest code? That will be really a great help for the superset opensource community.

piyush-singhal avatar Aug 28 '20 19:08 piyush-singhal

@piyush-singhal hi, so yeah the repo I had was very outdated compare the latest version of superset, back then there was not a folder called "superset-frontend".

and it look like "superset-fronted" is the "asset" folder that in the old repo, and I believe that the sub directory of those files are still the same, for example, incubator-superset/superset-frontend/src/visualizations/presets/MainPreset.js is the currently superset location for MainPreset.js where incubator-superset/superset/assets/src/visualizations/presets/MainPreset.js is the old location for MainPreset.js

Hence, in order to apply the changes that in from https://github.com/apache/incubator-superset/issues/3416, you will have to manually find those file and add the custom code and point superset to use the custom code, not the default library.

From my understanding, in MainPreset.js, it control which library your chart is going to use, for example, by default, pivot table type of chart is take from import PivotTableChartPlugin from '@superset-ui/legacy-plugin-chart-pivot-table';, and in order to use the custom code, we are going to point it to a custom plugin. An example would be the TimeTableChart plugin, which is default using a custom one (import TimeTableChartPlugin from '../TimeTable/TimeTableChartPlugin';).

For build the custom plugin, my old repo should have that but I would also recommend take a look at the original pivot table plugin library and use it as a template https://github.com/apache-superset/superset-ui/tree/master/plugins/legacy-plugin-chart-pivot-table/src

I hope this help

henry145145 avatar Aug 28 '20 20:08 henry145145