/** * Set up the theme customization form * * @param object $disco * @return void */ public function modify_form($disco) { $data = $this->get_customizaton_data(); $disco->add_element('background_color', 'colorpicker'); if (isset($data->background_color)) { $disco->set_value('background_color', $data->background_color); } $disco->add_element('text_color', 'colorpicker'); if (isset($data->text_color)) { $disco->set_value('text_color', $data->text_color); } $disco->add_element('banner_font', 'select_no_sort', array('options' => array('Verdana' => 'Verdana', 'Georgia' => 'Georgia', 'Comic Sans MS' => 'Comic Sans', 'Lucida Handwriting' => 'Lucida Handwriting'), 'add_empty_value_to_top' => true)); if (isset($data->banner_font)) { $disco->set_value('banner_font', $data->banner_font); } }
/** * This is an alias to FlashChart::chart('pie') that is only used for the * pie type. * * For options documentation; * http://teethgrinder.co.uk/open-flash-chart-2/pie-chart.php * * @example echo $flashChart->renderPie(); * @example echo $flashChart->renderPie(array('animate'=>false); * @param array $options * Valid options : values, animate, start_angle, tooltip * @param string $datasetName The name to be used to associate charts with data * @param string $chartId Name of chart. Use for seperate charts. * @return string */ public function pie($options = array(), $datasetName = 'default', $chartId = 'default') { if (empty($this->data[$datasetName])) { return false; } $this->Chart->set_bg_colour($this->bg_colour); $pie = new Pie(); foreach ($options as $key => $setting) { $set_method = 'set_' . $key; $pie->{$set_method}($setting); } if (!empty($this->tooltip)) { $pie->set_tooltip($this->tooltip); } $pies = array(); $labels = Set::extract($this->data, $this->labelsPath); $numbers = $this->getNumbers($datasetName); foreach ($numbers as $key => $value) { if (isset($labels[$key]) && is_string($labels[$key])) { $pies[] = new pie_value($value, $labels[$key]); } else { $pies[] = $value; } } $pie->set_values($pies); $this->Chart->add_element($pie); return $this->renderData($chartId); }