Download the PHP package kirschbaum-development/nova-chartjs without Composer

On this page you can find all versions of the php package kirschbaum-development/nova-chartjs. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package nova-chartjs

Nova Chart.js

Latest Version on Packagist Total Downloads

Introduction

This package allows you to easily add chart.js graphs to your nova resources. This project is under active development, and currently only supports Line and Bar Charts. You are welcome to request or contribute additional charts by opening an issue.

Requirements

This Nova field requires Nova 2.0 or higher.

Installation

You can install this package in a Laravel app that uses Nova via composer:

You'll also need to run migrations to set up a database table for NovaChartjsMetricValue

Setup

After setup, your model should include the KirschbaumDevelopment\NovaChartjs\Traits\HasChart trait and you must implement the KirschbaumDevelopment\NovaChartjs\Contracts\Chartable Contract.

You must also define a static getNovaChartjsSettings function in the model which should return the required settings for the Chart. All other required methods and relationship defined in the contract are already defined for you in the included trait. You can also override these trait methods directly on your model.

Adding Custom Datsets

You can also add your own custom datasets to the chart by adding a getAdditionalDatasets method on your model

You can read more about adding custom datasets in the official chart.js documentation

Creating a range chart

To create a range chart you can pass on two additional datasets representing an upper and lower range and set the fill and background color property for the first data point.

Adding Chart

You can add the chart to your Nova resource in three ways

  1. Our recommended way of using Nova Chartjs Chart is to add the included Panel KirschbaumDevelopment\NovaChartjs\InlinePanel to your resource's Nova fields

NOTE: You must pass the Resource (i.e. $this) and $request to the InlinePanel component.

As an optional argument you can pass a chart name as the third argument, showLabel as fourth argument, notEditable as the fifth argument and hideFromIndex as the sixth argument.

  1. If you instead want to use the Chart inline without a panel you can do so using this code:

NOTE: You can pass the name of the chart as the first argument for the make() function. You can also chain the showLabel() and notEditable() methods to show the label and prevent editing the model data via the resource.

Without showLabel() chart will occupy the full width even in Inline Mode.

  1. You can also display the chart as a relationship table and manage it on a separate page

Adding Multiple Charts

You can add multiple charts to your Nova resource by specifying a chart identifier.

NOTE: If no explicit identifier is specified default will be used as the identifier for that chart.

You can use the chart identifiers to specify separate additional datasets and settings for each charts.

Settings

You can add following settings to model settings

  1. parameters: It is a list of parameters label for which chart data will be collected. It should be passed as an array. e.g., ["January, "February", "March"]
  2. height and width: Dimensions of chart. It is recommended to set height and let chart adjust according to width.
  3. color: Color value for the base model in chart.
  4. identProp: Model property representing the primary key. defaults to id.
  5. labelProp: Model property used for display label in chart. defaults to id.
  6. indexColor: Bar Chart color in index view. Falls back to color
  7. type: line or bar. defaults to line.
  8. options: Options are passed directly to ChartJS instance can be used to customize your Chart as detailed in the documentation

Adding Chart Data

After setup, to add chart data for any model, all you need to do is to edit the model after creating it. You will get a list of numeric inputs to add values for each parameter specified in settings.

Chart data will also show on Model Index page as a Simple Bar Chart

Comparing Models

You can compare other related models to the current model using the comparison dropdown

You can add or remove any model to comparison to checkout how models are stacked against each other.

Changing Comparison Data

Chart comparison data is fetched through trait using a static function getNovaChartjsComparisonData. You can override this function in your model to change the comparison data.

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security

If you discover any security related issues, please email [email protected] or [email protected] instead of using the issue tracker.

Sponsorship

Development of this package is sponsored by Kirschbaum Development Group, a developer driven company focused on problem solving, team building, and community. Learn more about us or join us!

License

The MIT License (MIT). Please see License File for more information.


All versions of nova-chartjs with dependencies

PHP Build Version
Package Version
Requires php Version ^8.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package kirschbaum-development/nova-chartjs contains the following files

Loading the files please wait ....