Big Number with Trendline improvements #32755
richardfogaca
started this conversation in
Ideas
Replies: 2 comments
-
Hi, For those interested in testing the improvement, there's a branch where you can install and verify here I'm also attaching a chart I created. Please let me know if you find this feature useful for superset :) ![]() |
Beta Was this translation helpful? Give feedback.
0 replies
-
@eschutho @Antonio-RiveroMartnez @kgabryje @kasiazjc have worked on similar things lately, so I'll ping them here to get their feelings. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
BigNumberWithTrendline Improvements
Contribution Summary
We have enhanced the BigNumberWithTrendline chart, it may be worth considering the creation of a new chart type called "BigNumberDynamic". Here are the new features:
What We Added
We enhanced the BigNumberWithTrendline visualization with several practical features:
1. Top Header and Prefix
Screenshot
2. Calculation Options
Screenshot
Implementation Notes
Understanding the Relationship Between Comparison Types and COMPARISON PERIOD LAG
The BigNumberWithTrendline visualization uses two key settings that work together to show comparisons:
These settings work as follows:
How COMPARISON PERIOD LAG Works
The "COMPARISON PERIOD LAG" setting can sometimes be misunderstood. Here's what you need to know:
The comparison always involves exactly two values, regardless of the lag number:
For example, with a time series of [80, 85, 90, 95, 100] where 100 is the most recent value:
Common Misconception: Setting the lag to 2 or 3 does NOT mean that 3 or 4 values are being compared or averaged. It simply means looking back 2 or 3 periods for the comparison value.
The comparison is always between exactly two points - the current value and one historical value - regardless of which comparison type you select.
3. Dynamic Variables
Technical Details
The implementation includes:
New UI Elements: Added topheader and prefix text fields with responsive font sizing that adjusts based on container dimensions. The rendering logic maintains proper spacing and alignment with the main number.
Enhanced Data Processing: Modified the transformProps function to handle three different calculation types (values, difference, percentage) with appropriate formatting for each. Added logic to extract and calculate values based on the selected variable calculation method (first, last, sum, average, min, max).
New Control Panel Options: Added four new control sections:
Placeholder Replacement Logic: Implemented a replacePlaceholderWithValue function that scans header and subheader text for patterns like {{ metric_name }}, calculates the appropriate value based on the selected calculation method, and replaces the placeholder with the formatted value.
Why This Matters
These improvements solve real problems:
Better Context: The top header and prefix provide crucial context for the numbers being displayed.
Flexible Comparisons: Users can now choose how to display comparisons based on what makes sense for their data.
Dynamic Content: Headers and subheaders can now include calculated values from the dataset, making visualizations more informative and reducing the need for multiple charts.
Clearer Data Stories: These features help users create more informative visualizations without cluttering dashboards with additional charts.
With these improvements, the BigNumberWithTrendline visualization becomes significantly more useful for displaying KPIs and metrics that require context and comparison.
Contribution
New BigNumber Feature
The BigNumberWithTrendline visualization has been enhanced with a powerful new feature that allows for more flexible and informative data displays. This contribution addresses several key needs:
Implementation Notes
When using the "COMPARISON PERIOD LAG" option with different comparison types:
The comparison type selection determines how the comparison value is calculated and displayed, while the "COMPARISON PERIOD LAG" option determines which historical data point is used for the comparison. These options work together to provide a complete picture of how metrics are changing over time.
Usage Recommendations
For the most effective visualizations:
The dynamic variable feature works best when you need to incorporate calculated values from your dataset into your headers or subheaders, such as showing averages, totals, or extremes alongside your main metric.
Future Development
Given the significant enhancements to the BigNumberWithTrendline visualization, it may be worth considering the creation of a new chart type called "BigNumberDynamic" that specifically highlights these advanced features:
This would make it easier for users to discover and utilize these powerful features while maintaining backward compatibility with the original BigNumberWithTrendline chart.
Beta Was this translation helpful? Give feedback.
All reactions