OpenStudioCore:utilities
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Pages
Public Types | Public Member Functions | List of all members
openstudio::PieChart Class Reference

#include <PieChart.hpp>

Public Types

typedef std::shared_ptr< const
PieChart
ConstPtr
 
typedef std::vector< ConstPtrConstVec
 
typedef std::weak_ptr< const
PieChart
ConstWeakPtr
 
typedef std::shared_ptr< PieChartPtr
 
typedef std::vector< PtrVec
 
typedef std::weak_ptr< PieChartWeakPtr
 

Public Member Functions

void explodeSlice (unsigned index)
 configuration options More...
 
void hideSlice (unsigned index, bool hideLabel=false)
 hide a given slice by index, multiple slices may be hidden at any time the label for the slice may also be hidden in the legend More...
 
 PieChart (const std::string &title, const Vector &data, const std::vector< std::string > &labels)
 constructor takes title, data, and labels note dimension of labels must match dimensions of data More...
 
void save (const openstudio::path &path) const
 display the chart in QT More...
 
void setColors (const std::vector< Color > &colors)
 set the colors of each slice, dimensions must match More...
 
void setLabelFont (unsigned fontSize, const Font &font)
 set the font and size of the labels, use font size = 0 to hide More...
 
void setLegendFont (unsigned fontSize, const Font &font)
 set the font and size of the legend, use font size = 0 to hide More...
 
void setLegendLocation (LegendLocation loc)
 set the legend location More...
 
void setTitleFont (unsigned fontSize, const Font &font)
 set the font and size of the title, use font size = 0 to hide More...
 

Detailed Description

Class which represents a pie chart.

Data for the chart are stored in a Vector, with each element corresponding to a slice in the chart and each slice is labeled. The size of the pie is normalized to the sum of the data, slices may be hidden to represent "missing" sections.

Member Typedef Documentation

typedef std::shared_ptr<const PieChart > openstudio::PieChart::ConstPtr
typedef std::weak_ptr<const PieChart > openstudio::PieChart::ConstWeakPtr
typedef std::shared_ptr< PieChart > openstudio::PieChart::Ptr
typedef std::vector<Ptr> openstudio::PieChart::Vec
typedef std::weak_ptr< PieChart > openstudio::PieChart::WeakPtr

Constructor & Destructor Documentation

openstudio::PieChart::PieChart ( const std::string &  title,
const Vector &  data,
const std::vector< std::string > &  labels 
)

constructor takes title, data, and labels note dimension of labels must match dimensions of data

Member Function Documentation

void openstudio::PieChart::explodeSlice ( unsigned  index)

configuration options

explode a given slice by index, multiple slices may be exploded at any time

void openstudio::PieChart::hideSlice ( unsigned  index,
bool  hideLabel = false 
)

hide a given slice by index, multiple slices may be hidden at any time the label for the slice may also be hidden in the legend

void openstudio::PieChart::save ( const openstudio::path &  path) const

display the chart in QT

save the chart to file

void openstudio::PieChart::setColors ( const std::vector< Color > &  colors)

set the colors of each slice, dimensions must match

void openstudio::PieChart::setLabelFont ( unsigned  fontSize,
const Font &  font 
)

set the font and size of the labels, use font size = 0 to hide

void openstudio::PieChart::setLegendFont ( unsigned  fontSize,
const Font &  font 
)

set the font and size of the legend, use font size = 0 to hide

void openstudio::PieChart::setLegendLocation ( LegendLocation  loc)

set the legend location

void openstudio::PieChart::setTitleFont ( unsigned  fontSize,
const Font &  font 
)

set the font and size of the title, use font size = 0 to hide