<fieldset class="adminform">
    <legend><?php echo JText::_('Chart Data'); ?></legend>
    <div id="chartToolbar">
        <a href="javascript:Chart.addCol()" class="addCol"><?php echo $this->chart->chartLanguages['addLabel']; ?></a>
        <a href="javascript:Chart.remove()" class="removeCol"><?php echo $this->chart->chartLanguages['removeLabel']; ?></a>
        <div class="cleaner"></div>
    </div>
    <div id="editcell">
    	<table class="adminlist">
    		<thead>
    			<tr id="items-labels-row">
    				<th class="title" align="left">
    					<input type="checkbox" id="items-check-all" onclick="Chart.checkAll()"/>
    				</th>
    				<th class="title">
    					<span class="editlinktip hasTip" title="<?php echo JText::_('Name'); ?>::<?php echo JText::_('Name Title'); ?>">
    					    <?php echo JText::_('Name'); ?>
    					</span>
    				</th>
    				<th class="title">
    					<span class="editlinktip hasTip" title="<?php echo JText::_('Value'); ?>::<?php echo JText::_('Value Title'); ?>">
    					    <?php echo JText::_('Value'); ?>
    					</span>
    				</th>
    				<th class="title">
    					<span class="editlinktip hasTip" title="<?php echo JText::_('Color'); ?>::<?php echo JText::_('Color Title'); ?>">
    					    <?php echo JText::_('Color'); ?>
    					</span>
    				</th>
    				<th class="title">
    					<span class="editlinktip hasTip" title="<?php echo JText::_('Hover Text'); ?>::<?php echo JText::_('Hover Text Title'); ?>">
    					    <?php echo JText::_('Hover Text'); ?>
    					</span>
    				</th>
    				<th class="title">
    					<span class="editlinktip hasTip" title="<?php echo JText::_('Link'); ?>::<?php echo JText::_('Link Title'); ?>">
    					    <?php echo JText::_('Link'); ?>
    					</span>
    				</th>
    				<th class="title">
    					<span class="editlinktip hasTip" title="<?php echo JText::_('Alpha'); ?>::<?php echo JText::_('Alpha Title'); ?>">
    					    <?php echo JText::_('Alpha'); ?>
    					</span>
    				</th>
    				<th class="title">
    					<span class="editlinktip hasTip" title="<?php echo JText::_('Show Name'); ?>::<?php echo JText::_('Show Name Title'); ?>">
    					    <?php echo JText::_('Show Name'); ?>
    					</span>
    				</th>
    				<?php if($this->chart->chartSetting['addIsSliced']) { ?>
    					<th class="title">
    						<span class="editlinktip hasTip" title="<?php echo JText::_('Is Sliced'); ?>::<?php echo JText::_('Is Sliced Title'); ?>">
    					        <?php echo JText::_('Is Sliced'); ?>
    						</span>
    					</th>
    				<?php } ?>
    			</tr>	
    		</thead>			
    		<tbody id="dataBody">				
                <?php foreach ($this->chart->data as $i=>$item) { ?>
                    <?php JFilterOutput::objectHTMLSafe($item, ENT_QUOTES); ?>
                    <?php $id = $i + 1; ?>
        			<tr id="items-values-row-<?php echo $id; ?>" class="row<?php echo $i%2; ?>">
        				<td>	
        					<input type="checkbox" id="item-checkbox-<?php echo $id; ?>" name="item-checkbox-<?php echo $id; ?>" value="<?php echo $id; ?>"/>
        				</td>
        				<td>
        					<input type="text" id="item-label-<?php echo $id; ?>" name="item-label[<?php echo $i; ?>]" value="<?php echo $item->label; ?>" size="30" tabindex=""/>
        				</td>
        				<td>		
        					<input type="text" id="item-value-<?php echo $id; ?>" name="item-value[<?php echo $i; ?>]" value="<?php echo $item->value; ?>" size="10"/>
        				</td>	
        				<td>		
        					<input class="color {pickerPosition:'top',required:false}" id="item-color-<?php echo $id; ?>" name="item-color[<?php echo $i; ?>]" value="<?php echo $item->color; ?>" size="7" maxLength="7"/>
        				</td>
        				<td>		
        					<input type="text"  id="item-htext-<?php echo $id; ?>"name="item-htext[<?php echo $i; ?>]" value="<?php echo $item->htext; ?>" size="30"/>
        				</td>
        				<td>		
        					<input type="text" id="item-link-<?php echo $id; ?>" name="item-link[<?php echo $i; ?>]" value="<?php echo $item->link; ?>" size="30"/>
        				</td>
        				<td>		
        					<input type="text" id="item-alpha-<?php echo $id; ?>" name="item-alpha[<?php echo $i; ?>]" value="<?php echo $item->alpha; ?>" size="3" maxLength="3"/>
        				</td>
        				<td>	
        					<input type="checkbox" id="item-show-<?php echo $id; ?>"name="item-show[<?php echo $i; ?>]" value="<?php echo $id; ?>" <?php echo $item->show ? 'checked="checked"' : ''; ?>/>
        				</td>
        				<?php if($this->chart->chartSetting['addIsSliced']) { ?>
        					<td>	
        						<input type="checkbox" id="item-isSliced-<?php echo $id; ?>"name="item-isSliced[<?php echo $i; ?>]" value="<?php echo $id; ?>" <?php echo $item->isSliced ? 'checked="checked"' : ''; ?>/>
        					</td>
        				<?php } ?>
        			</tr>		
                <?php } ?>
                <?php if ( count ( $this->chart->data ) == 0 ) { ?>
                	<tr class="row0" id="emptyItemsInfo">
                		<td colspan="9"> 
                            <?php echo JText::_('Click on Add Column Button to Create Column'); ?>
                		</td>
                	</tr>
                <?php } ?>
    		</tbody>
    	</table>
    	<?php if(!$this->chart->id && (int) $this->config->get('sample_data_sc', 1)) { ?>
    		<p class="sampleDataInfo"><?php echo JText::_('The chart was rendered by sample data'); ?></p>
        <?php } ?>
    </div>
</fieldset>

<?php 
    $document = &JFactory::getDocument();
    $document->addScriptDeclaration('var addIsSliced = ' . ($this->chart->chartSetting['addIsSliced'] ? 'true' : 'false') . ';');
?>

<input type="hidden" name="lastID" id="lastID" value="<?php echo count($this->chart->data); ?>" />