Closed Etiennepi closed 8 years ago
You should be able to provide separate <urth-viz-col>
tags for each column. Can you provide an example?
Hi, sure. Here's an example of the data I have:
columns_names = ['mon', 'tues', 'wed', 'thurs', 'fri', 'sat', 'sun']
data = np.random.rand(24, 7)
df = pd.DataFrame(data=data, columns=columns_names)
Here's the function that feeds the data to the table:
def table_function():
newDf = df
return newDf.reset_index()
And here is how my table is defined:
%%html
<template is="urth-core-bind">
<urth-core-function ref="table_function"
result="{{table_function_result}}"
auto>
</urth-core-function>
<urth-viz-table datarows="{{table_function_result.data}}"
rows-visible="10"
columns="{{table_function_result.columns}}"
selection-as-object>
<urth-viz-col format='0.00%' index=1 type=numeric></uth-viz-col>
<urth-viz-col format='0.00%' index=2 type=numeric></uth-viz-col>
<urth-viz-col format='0.00%' index=3 type=numeric></uth-viz-col>
<urth-viz-col format='0.00%' index=4 type=numeric></uth-viz-col>
<urth-viz-col format='0.00%' index=5 type=numeric></uth-viz-col>
<urth-viz-col format='0.00%' index=6 type=numeric></uth-viz-col>
<urth-viz-col format='0.00%' index=7 type=numeric></uth-viz-col>
</urth-viz-table>
</template>
And here's the result I get, with only the 'mon' row appearing as percentages:
@aluu317
@peller Any thoughts?
Mobile thumb press. Sorry!
You're missing an 'r' at the closing tags for </urth-viz-col>
Thanks @aluu317
You were right, sorry for not catching that myself, and thanks.
Hi, I have a table with a column for each day of the week and the time (0 to 1 am, 2 to 3 am, etc) as indexes. Each cell should pe a percentage, but I can't affect more than one column with a urth-viz-col with type=numeric. I've attempted placing one urth-viz-col tag for each day, only the first got taken into account. I've tried giving a list of all the columns as index, as well as not giving it an index at all. The best result I've been able to get was to set a single column's data as percentages. Any ideas what I might be doing wrong? Or could this be a bug?