Ask AI
Skip to main content

Clear line chart

Function: Clear line chart

This action allows you to instantly remove all data displayed on a specific Line Chart component within your application. It's useful when you want to reset a chart, prepare it for new data, or simply hide the current data without removing the chart component itself.

Input

  • UI element (Type: PART, specifically a Line Chart)
    • The Line Chart component on your page that you wish to clear. This is a required input, meaning you must specify which chart to clear.

Output

This function does not produce any direct output. It performs an action on the specified UI element, clearing its displayed data.

Execution Flow

Real-Life Examples

  1. Resetting a Sales Performance Chart:

    • Scenario: You have a dashboard showing sales performance over time in a Line Chart. Users can apply various filters (e.g., by region, product category). You want to provide a "Reset Filters" button that, when clicked, also clears the chart before new data is loaded based on the reset filters.
    • Inputs:
      • UI element: Sales Performance Chart (the specific Line Chart component on your dashboard)
    • Result: The Sales Performance Chart will instantly become empty, ready to display new data once the filters are reset and new data is fetched.
  2. Preparing a Chart for New Customer Data:

    • Scenario: In a customer management application, when a user selects a new customer from a list, you want to display their historical order data in a Line Chart. Before loading the new customer's data, you need to clear any data from the previously viewed customer to avoid confusion.
    • Inputs:
      • UI element: Customer Order History Chart (the Line Chart component showing order history)
    • Result: The Customer Order History Chart will be cleared of all previous data, ensuring that only the newly selected customer's information is displayed.
  3. Clearing a Chart on Page Load (Conditional):

    • Scenario: You have a report page with a Line Chart that should only display data after a user clicks a "Generate Report" button. On initial page load, you want the chart to be empty, preventing any stale or default data from being shown until the user actively generates a report.
    • Inputs:
      • UI element: Monthly Report Chart (the Line Chart component on your report page)
    • Result: When the page loads, the Monthly Report Chart will be empty, providing a clean slate for the user to generate their desired report.