CCustomRadialChart


This class is a base class for most chart widgets with radial(polar) coordinate space. This base class is responsible for background. Chart data management and drawing, as well as grids and labels, is left to be implemented in actual control class. If you are creating a chart widget using radial coordinate space you most like will save some time if you derive your control from this class and avoid writing already implemented features.

You can find more information in comments below. Overrided methods can be found in corresponding base class.

class CCustomRadialChart :public virtual IRadialChart, public CControl
{
protected:
    IChartDataSet *m_pDataSet; // Data set 
    Color m_sBackgroundColor; //Background color 
    Gradient m_cBackgroundGradient; // Background gradient 

    ITexture *m_pCanvas; // Canvas 
    IChartData *m_pHoveredData; // Hovered data 
    int m_iHoveredPoint; // Hovered point index 
    bool m_bIgnoreGradient; // Whether gradient changes should be ignored 

    virtual bool UpdateHoveredPoint(); // Update hovered point using curren mouse pointer coordinates 
    virtual bool UpdateHoveredPoint(const PointF &position) = 0; // Update hovered point assuming mouse pointer is at specified position(in form coordinate space) 
    virtual void UpdateFromStyle(IStyle *style); // Update from style 
    virtual void Render(); // Render all 
    virtual void RenderBackground(IRenderer *renderer, const RectF &rect); // Render background only. Called by Render() 
    virtual void RenderDataSet(IRenderer *renderer, const RectF &rect) = 0; // Render data set only 
public:
    // IControl methods 
    void Refresh(const bool refresh_children) override;

    // IRadialChart getters 
    IChartDataSet *getDataSet() override;

    // IRadialChart setters 
    bool setDataSet(IChartDataSet *value, const bool release_old) override;

    // IRadialChart methods 
    void Update() override;

    CCustomRadialChart(
        const String &class_name,
        const bool accept_form,
        const bool accept_control,
        const bool accept_controls,
        const bool accept_focus,
        const bool accept_modal,
        const bool tab_stop,
        const Point &design_dpi = DesignDPI);
    ~CCustomRadialChart() override;

    Color getBackgroundColor() const; // Return background color 
    Gradient *getBackgroundGradient(); // Return background gradient 

    bool setBackgroundColor(const Color &value); // Set background color 
};
Namespace: nitisa::charts
Include: Charts/Core/CustomRadialChart.h