Return the jSON encode of this chart

@brief JSON

@return string
978213
public function toJSON()
  {
    $json = json_encode( $this->toArray() );

    return str_replace(
      [
          '"%hoverCallback%"',
          '"%formatter%"',
          '"%dateFormat%"',
      ],
      [
          $this->hoverCallback,
          $this->formatter,
          $this->dateFormat,
      ],
      $json
    );
  }
1117161
public function getJson()
    {
        global $CFG, $PDOX;

        $row = $PDOX->rowDie("SELECT json FROM {$CFG->dbprefix}{$this->TABLE_NAME}
                WHERE $this->PRIMARY_KEY = :PK",
            array(":PK" => $this->id));
        if ( $row === false ) return false;
        $json = $row['json'];
        if ( $json === null ) return false;
        return $json;
    }
752656
public function jsonSerialize()
    {
        return [
            'draw'            => (int) $this->draw,
            'recordsTotal'    => (int) $this->recordsTotal,
            'recordsFiltered' => (int) $this->recordsFiltered,
            'data'            => $this->data,
        ];
    }
13291
public function toDatatablesJSONString() {
		$return_object_array = [ ];
		$fields = $this->getFields ();
		foreach ( $fields as $field ) {
			$value = call_user_func ( array (
					$this,
					'get' . $field 
			) );
			if ($value instanceof \DateTime) {
				$value = $value->format ( 'Y-m-d' );
			}
			array_push ( $return_object_array, array (
					$field => $value 
			) );
		}
		return json_encode ( $this );
	}
300749
protected function formatJSON()
    {
        $result = new \stdClass();

        if ($this->outputMode == self::MODE_ERROR) {
            $this->formatFailure($result);
        } else {
            $this->formatSuccess($result);
        }

        // include valid, plain non-namespace data
        foreach ($this->plain as $key => $value) {
            $result->$key = $value;
        }
        //TODO: better handling of links (self, related, pagination) http://jsonapi.org/format/#document-links

        if ($this->meta) {
            $result->meta = $this->meta;
        }

        return $result;
    }
824764
public function getJson() {
		$json = [
			'title' => $this->title,
			'author' => $this->author,
			'show_cover_pic' => $this->show_cover_pic,
			'digest' => $this->digest,
			'content_source_url' => $this->content_source_url,
		];
		if($this->manager) {
			$materialMedia = $this->thumbMaterialMedia;
			$json['thumb_media_id'] = $materialMedia->media_id;
			$json['thumb_material_media_id'] = $materialMedia->id;
			$json['content'] = $this->wechatContent;
		} else {
			$json['thumb_url'] = $this->thumbMaterial->url;
			$json['content'] = $this->content;
		}
		
		return $json;
	}
1367582
public function toJSON($pretty = false)
    {
        if (!$pretty) {
            return json_encode($this->expose());
        } else {
            return $this->prettyPrint(json_encode($this->expose()));
        }
    }
925621
public function get(): string
    {
        $array = (new ToArrayConverter($this->jory, $this->minified))->get();

        // if array is empty convert into empty object
        // To prevent json being an array [] instead of an object {}
        if (empty($array)) {
            $array = new \stdClass();
        } else {
            $this->fixEmptyRelationArrays($array);
        }

        return json_encode($array);
    }
399065
public function encode()
    {
        if (is_null($this->getParameter('value')))
            return '""';

        $value = $this->getParameter('value');
        $index = $this->getParameter('index');

        if($index != null && is_array($value))
            return JSONUtils::encode($value[$index]);

        return JSONUtils::encode($value);
    }
992048
public function getNotifyResponseStringJson() {
    $response['Result'] = $this->notifyResponse['Result'];
    $response['ErrorMessage'] = $this->notifyResponse['ErrorMessage'];
    $response['OrderId'] = $this->notifyResponse['OrderId'];
    $response['CustomerId'] = $this->notifyResponse['CustomerId'];
    $response['MailSent'] = $this->notifyResponse['MailSent'];
    $response['Timestamp'] = time();

    return json_encode($this->notifyResponse);
  }
589852
public function json() {
		$json = parent::json();

		$json['button_text'] = $this->button_text;
		$json['button_url']  = esc_url( $this->button_url );

		return $json;
	}
1116093
public function toJSON()
    {
        $mapper = static::getMapper();
        $json = [];

        foreach ($this->toArray() as $key => $value) {
            $attribute = $mapper->getAttribute($key);
            $json[$key] = Type::factory($attribute['type'])->toJSON($value, $attribute);
        }

        return $json;
    }
36408
public function to_json() {
		parent::to_json();
		foreach ( $this->input_attrs as $attr => $value ) {
			if ( 'style' !== $attr ) {
				$this->json['inputAttrs'] .= $attr . '="' . esc_attr( $value ) . '" ';
				continue;
			}
			$this->json['labelStyle'] = 'style="' . esc_attr( $value ) . '" ';
		}
	}
1267619
public function jsonVal()
    {
        $json = $this->propertyVal();
        if (!is_string($json)) {
            $json = json_encode($json);
        }
        if (!$json || $json == 'null') {
            $json = '';
        }
        return $json;
    }
244990
public function toJSON(): string
    {
        $this->internalDataListUpdate();

        // Copied from DataObjectToJSONTrait. Do not modify here !!!
        $toJSON = function($object): string {
            $result = [];

            $vars = get_object_vars($object);
            foreach ($vars as $name => $value) {
                if ($name !== 'internalDataObjectData') {
                    $reflectionProperty = new \ReflectionProperty($object, $name);
                    if ($reflectionProperty->isPublic()) {
                        $result[$name] = null;
                    }
                }
            }
            $propertiesToEncode = [];
            if (isset($object->internalDataObjectData)) {
                foreach ($object->internalDataObjectData as $name => $value) {
                    $result[substr($name, 1)] = null;
                    if (substr($name, 0, 1) === 'p' && isset($value[7])) { // encodeInJSON is set
                        $propertiesToEncode[substr($name, 1)] = true;
                    }
                }
            }
            ksort($result);
            foreach ($result as $name => $null) {
                $value = $object instanceof \ArrayAccess ? $object[$name] : (isset($object->$name) ? $object->$name : null);
                if (method_exists($value, 'toJSON')) {
                    $result[$name] = $value->toJSON();
                } else {
                    if ($value instanceof \DateTime) {
                        $value = $value->format('c');
                    }
                    if (isset($propertiesToEncode[$name]) && $value !== null) {
                        if (is_string($value)) {
                            $value = 'data:;base64,' . base64_encode($value);
                        } else {
                            throw new \Exception('The value of the ' . $name . ' property cannot be JSON encoded. It must be of type string!');
                        }
                    }
                    $result[$name] = json_encode($value);
                    if ($result[$name] === false) {
                        throw new \Exception('Invalid characters in ' . $name . '! Cannot JSON encode the value: ' . print_r($value, true));
                    }
                }
            }
            $json = '';
            foreach ($result as $name => $value) {
                $json .= '"' . addcslashes($name, '"\\') . '":' . $value . ',';
            }
            $json = '{' . rtrim($json, ',') . '}';
            return $json;
        };

        $json = '';
        foreach ($this->internalDataListData as $index => $object) {
            $object = $this->internalDataListUpdateValueIfNeeded($this->internalDataListData, $index);
            if (method_exists($object, 'toJSON')) {
                $json .= $object->toJSON() . ',';
            } else {
                $json .= $toJSON($object) . ',';
            }
        }
        $json = '[' . rtrim($json, ',') . ']';
        return $json;
    }
9830
public function to_json() {
		parent::to_json();

		// We need to make sure we have the correct image URL.
		foreach ( $this->choices as $value => $args ) {
			$this->choices[ $value ]['url'] = esc_url( sprintf( $args['url'], get_template_directory_uri(), get_stylesheet_directory_uri() ) );
		}
		$this->json['choices'] = $this->choices;
		$this->json['link']    = $this->get_link();
		$this->json['value']   = $this->value();
		$this->json['id']      = $this->id;
	}
337449
public function jsonSerialize(){
		$arrData = array();

		foreach($this as $strKey => $objValue){
			if($this->options($strKey)->json){
				$mixValue = $objValue->jsonSerialize();
				$mixJSON = json_encode($mixValue);
				if((!is_null($mixValue) && $mixJSON!='[]') || $this->options($strKey)->jsonnull){
					$arrData[$strKey] = $mixValue;
				}
			}
		}
		return $arrData;
	}