public function clean0Values(array $Data, array $Palette, $DataSerie, $AbscissaSerie)
    {
        $NewPalette = [];
        $NewData = [];
        $NewAbscissa = [];

        /* Remove unused series */
        foreach (array_keys($Data["Series"]) as $SerieName) {
            if ($SerieName != $DataSerie && $SerieName != $AbscissaSerie) {
                unset($Data["Series"][$SerieName]);
            }
        }

        /* Remove null values */
        foreach ($Data["Series"][$DataSerie]["Data"] as $Key => $Value) {
            if ($Value != 0) {
                $NewData[] = $Value;
                $NewAbscissa[] = $Data["Series"][$AbscissaSerie]["Data"][$Key];
                if (isset($Palette[$Key])) {
                    $NewPalette[] = $Palette[$Key];
                }
            }
        }
        $Data["Series"][$DataSerie]["Data"] = $NewData;
        $Data["Series"][$AbscissaSerie]["Data"] = $NewAbscissa;

        return [$Data, $NewPalette];
    }
public function clean0Values(array $Data, array $Palette, $DataSerie, $AbscissaSerie)
    {
        $NewPalette = [];
        $NewData = [];
        $NewAbscissa = [];

        /* Remove unused series */
        foreach (array_keys($Data["Series"]) as $SerieName) {
            if ($SerieName != $DataSerie && $SerieName != $AbscissaSerie) {
                unset($Data["Series"][$SerieName]);
            }
        }

        /* Remove null values */
        foreach ($Data["Series"][$DataSerie]["Data"] as $Key => $Value) {
            if ($Value != 0) {
                $NewData[] = $Value;
                $NewAbscissa[] = $Data["Series"][$AbscissaSerie]["Data"][$Key];
                if (isset($Palette[$Key])) {
                    $NewPalette[] = $Palette[$Key];
                }
            }
        }
        $Data["Series"][$DataSerie]["Data"] = $NewData;
        $Data["Series"][$AbscissaSerie]["Data"] = $NewAbscissa;

        return [$Data, $NewPalette];
    }
public function clean0Values ( array $ Data , array $ Palette , $ DataSerie , $ AbscissaSerie ) { $ NewPalette = [ ] ; $ NewData = [ ] ; $ NewAbscissa = [ ] ; /* Remove unused series */ foreach ( array_keys ( $ Data [ "Series" ] ) as $ SerieName ) { if ( $ SerieName != $ DataSerie && $ SerieName != $ AbscissaSerie ) { unset ( $ Data [ "Series" ] [ $ SerieName ] ) ; } } /* Remove null values */ foreach ( $ Data [ "Series" ] [ $ DataSerie ] [ "Data" ] as $ Key => $ Value ) { if ( $ Value != 0 ) { $ NewData [ ] = $ Value ; $ NewAbscissa [ ] = $ Data [ "Series" ] [ $ AbscissaSerie ] [ "Data" ] [ $ Key ] ; if ( isset ( $ Palette [ $ Key ] ) ) { $ NewPalette [ ] = $ Palette [ $ Key ] ; } } } $ Data [ "Series" ] [ $ DataSerie ] [ "Data" ] = $ NewData ; $ Data [ "Series" ] [ $ AbscissaSerie ] [ "Data" ] = $ NewAbscissa ; return [ $ Data , $ NewPalette ] ; }
Remove unused series & values
@param array $Data
@param array $Palette
@param string $DataSerie
@param string $AbscissaSerie
@return array
Remove unused series & values