How to output values


#1

This might sound silly and noobish, but how can I output say value from dataframe anywhere in dash? Lets say I want to make pie chart, and in title I want the value to be total sum of values.

Or anywhere else, how can I output any data, other than graphing it? I plan to use callbacks and output sums or some other aggregated data. Are there any examples like that? Did not find any in user guide, but maybe I overlooked :slight_smile:

edit: remembered of print option, but still anything other usable?

Thanks in advance!


#2

I think I’ve answered a question on this relatively recently here. Essentially you want to create a callback that targets the children property of an element already in your DOM. You can either return a string which contains the value you want to insert into the DOM, or a layout tree that has some formatting eg htm.P(value, className="result"). If this was being returned by a callback targeting the children property of an element with id “result-container”, then the inner html of that element would be replaced by the result of your callback.