You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: mini_histogram.rs
    path of file: ./repos/console/tokio-console/src/view
    
    the code of the file until where you have to start completion: use std::time::Duration;

use ratatui::{
    layout::Rect,
    style::Style,
    symbols,
    widgets::{Block, Widget},
};

use crate::state::histogram::DurationHistogram;

/// This is a Ratatui widget to visualize a latency histogram in a small area.
/// It is based on the [`Sparkline`] widget, so it draws a mini bar chart with
/// some labels for clarity. Unlike Sparkline, it does not omit very small
/// values.
///
/// [`Sparkline`]: ratatui::widgets::Sparkline
pub(crate) struct MiniHistogram<'a> {
    /// A block to wrap the widget in
    block: 
    
fn chart_data(histogram: &DurationHistogram, width: u16) -> (Vec<u64>, HistogramMetadata) {
    let &DurationHistogram {
        ref histogram,
        high_outliers,
        highest_outlier,
        ..
    } = histogram;

    let step_size = ((histogram.max() - histogram.min()) as f64 / width as f64).ceil() as u64 + 1;
    // `iter_linear` panics if step_size is 0
    let data = if step_size > 0 {
        let mut found_first_nonzero = false;
        let data: Vec<u64> = histogram
            .iter_linear(step_size)
            .filter_map(|value| {
                let count = value.count_since_last_iteration();
                // Remove the 0s from the leading side of the buckets.
                // Because HdrHistogram can return empty buckets depending
                // on its internal state, as it approximates values.
                if count == 0 && !found_first_nonzero {
                    None
                } else {
                    found_first_nonzero = true;
                    Some(count)
                }
            })
            .collect();
        data
    } else {
        Vec::new()
    };
    let max_bucket = data.iter().max().copied().unwrap_or_default();
    (
        data,
        HistogramMetadata {
            max_value: histogram.max(),
            min_value: histogram.min(),
            max_bucket,
            high_outliers,
            highest_outlier,
        },
    )
}