anouar-zh opened a new issue #9738:
URL: https://github.com/apache/incubator-superset/issues/9738
**Feature Request:**
I believe there is much demand for a KPI monitoring chart type such as a
gauge or other forms of KPI Visualization Types.
Due to lack of these kind of charts I believe it must be possible to add a
small piece of javascript to conditionally format cells in a table.
I added the following piece of code to
templates/superset/partials/asset_bundle.html
Is this the right way?
**Templates/superset/partials/asset_bundle.html**
```
{% macro js_bundle(filename) %}
{# HTML comment is needed for webpack-dev-server to replace assets
with development version #}
<!-- Bundle js {{ filename }} START -->
{% for entry in js_manifest(filename) %}
<script src="{{ entry }}"></script>
<script src="override.js"></script> |<<<<<<<<<<<<<<<
{% endfor %}
<!-- Bundle js {{ filename }} END -->
{% endmacro %}
{% macro css_bundle(filename) %}
<!-- Bundle css {{ filename }} START -->
{% for entry in css_manifest(filename) %}
<link rel="stylesheet" type="text/css" href="{{ entry }}" />
{% endfor %}
<!-- Bundle css {{ filename }} END -->
{% endmacro `%}
```
**Override.js**
```
var table = document.getElementById("DataTables_Table_0");
var tbody = document.getElementsByTagName("tbody")[0];
var cells = document.getElementsByTagName("td");
for (var i=0, len=cells.length; i<len; i++){
if (parseInt(cells[i].innerHTML,10) > 5){
cells[i].className = 'red';
}
else if (parseInt(cells[i].innerHTML,10) < -5){
cells[i].className = 'green';
}
}
```
Where should I place this override.js and lateron the css files?
Is this a valid way of adding a simple js to have some kind of conditional
formatting?
Any suggestions or help is appreciated
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]