Charts and Graphs for unity3d [Released]

Graph And Chart is available in the asset store: You Can Get It Here

https://www.youtube.com/watch?v=rWOm_5PNzKk

The leading charting asset for Unity. 2D and 3D , Beautiful Responsive and Interactive. All charts are completely customizable and can be set up quickly either from code or from the unity editor.

40 Minute tutorial video

Support is always available at : support@bitsplash.io

Your product is excellent and very customziable ! Just one question, My client has this idea of adding fire on top of each bar in the bar chart. I noticed there are plenty of ready made prefabs for bar and pie chart. Is there a way i can create a prefab with fire on top ?

Hi there!
If i get you correctly you would like to add a particle effect to your chart.
This can be done by duplicating one of the existing prefabs and adding a child object with the particle system effect you would like to add.
So for example you can duplicate the prefab at : Chart And Graph/Prefabs/3D/stretch bar. Then add the particle effect as a child object on top of the prefab and assign it to your chart.

Hello.
When you build for UWP10 (Hololens) I have problems with TimeZoneInfo.ConvertTimeToUtc and ToShortTimeString() to make it work change ChartDateUtility.cs

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ChartAndGraph
{
    /// <summary>
    /// holds date values
    /// </summary>
    class ChartDateUtility
    {
        private static DateTime Epoch = new DateTime(1970, 1, 1, 0, 0, 0, 0, System.DateTimeKind.Utc);

        public static double DateToValue(DateTime dateTime)
        {
            //dateTime = TimeZoneInfo.ConvertTimeToUtc(dateTime);
            TimeZoneInfo.ConvertTime(dateTime, TimeZoneInfo.FindSystemTimeZoneById("GMT Standard Time"));
            return (dateTime - Epoch).TotalSeconds;
        }
        public static string DateToTimeString(DateTime dateTime)
        {
            //return dateTime.ToShortTimeString();
            return dateTime.ToString("t");
        }
        public static string DateToDateString(DateTime dateTime)
        {
            //return dateTime.ToShortDateString();
            return dateTime.ToString("d");
        }
        public static string DateToDateTimeString(DateTime dateTime)
        {
            //return string.Format("{0}{1}{2}",dateTime.ToShortDateString(),Environment.NewLine, dateTime.ToShortTimeString());
            return string.Format("{0}{1}{2}", dateTime.ToString("d"), Environment.NewLine, dateTime.ToString("t"));
        }
        public static DateTime ValueToDate(double value)
        {
            return Epoch.AddSeconds(value);
        }
    }
}

Hello and thank you for you feed back and for purchasing our product. Another thing that could work is not converting to utc at all , This should work on hololens , as well all the other platforms.
This fix will be added to the next version

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using UnityEngine;

namespace ChartAndGraph
{
    /// <summary>
    /// holds date values
    /// </summary>
    class ChartDateUtility
    {
        private static DateTime Epoch = new DateTime(1970, 1, 1, 0, 0, 0, 0, System.DateTimeKind.Utc);

        public static double DateToValue(DateTime dateTime)
        {
            //dateTime = TimeZoneInfo.ConvertTimeToUtc(dateTime);
            return (dateTime - Epoch).TotalSeconds;
        }
        public static string DateToTimeString(DateTime dateTime)
        {
            return dateTime.ToShortTimeString();
        }
        public static string DateToDateString(DateTime dateTime)
        {
            return dateTime.ToShortDateString();
        }
        public static string DateToDateTimeString(DateTime dateTime)
        {
            return string.Format("{0}{1}{2}",dateTime.ToShortDateString(),Environment.NewLine, dateTime.ToShortTimeString());
        }
        public static DateTime ValueToDate(double value)
        {
            return Epoch.AddSeconds(value);
        }
    }
}

.ToShortTimeString() - also does not work.
And I hope you’re on the road avoiding the Resources folder.

Your comments are noted , and will be updated for the next version. Thank you for your feed back.
Attaced the source code of the final fix:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using UnityEngine;

namespace ChartAndGraph
{
    /// <summary>
    /// holds date values
    /// </summary>
    class ChartDateUtility
    {
        private static DateTime Epoch = new DateTime(1970, 1, 1, 0, 0, 0, 0, System.DateTimeKind.Utc);

        public static double DateToValue(DateTime dateTime)
        {
            //dateTime = TimeZoneInfo.ConvertTimeToUtc(dateTime);
            return (dateTime - Epoch).TotalSeconds;
        }
        public static string DateToTimeString(DateTime dateTime)
        {
            return dateTime.ToString("t");
        }
        public static string DateToDateString(DateTime dateTime)
        {
            return dateTime.ToString("d");
        }
        public static string DateToDateTimeString(DateTime dateTime)
        {
            return string.Format("{0}{1}{2}", return dateTime.ToString("d"), Environment.NewLine, dateTime.ToString("t"));
        }
        public static DateTime ValueToDate(double value)
        {
            return Epoch.AddSeconds(value);
        }
    }
}
1 Like

An update containing the fix and resources folder reduced to bare essentials has been submitted to unity for review. Should hit the store in a couple of days.

Thanks for fix.

Is any way to improve shaders to use single pass rendering methods?

Another bug, to recreate it you must:
1 Create new scene
2 Create UI canvas
3 Set canvas to word space
4 Set scale of canvas 0.1
5 Set position to 0 0 0
6 Create Image - parent of canvas
7 Create Tools-Charts-Graph-Simple as parent of image
8 Set recttransform to stretch by width and height
9 Rotate root canvas by set 0,30,0
10 Play

It create charts with wrong rotation.

Orientation bug is fixed , contact me with email and i will send a hot fix, will be updated at the store also.

Regarding the shaders. 3d gradient works like unity’s toon shader, which uses a few passes. this choice is due to visual apearance , toon shaders makes gradients look much better. However your comment is noted , another gradient shader will be added.

Thank you for shader explanation. And for a quick hot-fix - send you an email, with on http://prosourcelabs.com/index.php/contact-us/

Added an example of how to dynamically add and remove categories , this on is for the bar chart but is similar to other charts. (other charts require different arguments)

groups can be added in the same way , using AddGroup and RemoveGroup

public class BarChartFeed : MonoBehaviour {

    public Material CutomCategoryMaterial;

    void Start ()
    {
        BarChart barChart = GetComponent<BarChart>();
        if (barChart != null)
        {
            barChart.DataSource.SetValue("Player 1", "Value 1", Random.value * 20);
            barChart.DataSource.SlideValue("Player 2", "Value 1", Random.value * 20, 40f);

            barChart.DataSource.AddCategory("Player 4", CutomCategoryMaterial); // Add a category

            barChart.DataSource.SlideValue("Player 4", "Value 1", Random.value * 20, 40f);

           barChart.DataSource.RemoveCategory("Player 4");     // remove a category
        }
    }
}

Hi,

I get this error when I try to remove a category…

transform.localPosition assign attempt for ‘New Game Object’ is not valid. Input localPosition is { NaN, 0.000000, NaN }.
UnityEngine.Transform:set_localPosition(Vector3)
ChartAndGraph.BarChart:CreateBar(Vector3, Double, Single, Single, String, String, Int32, Int32) (at Assets/Chart and Graph/Script/BarChart/BarChart.cs:444)
ChartAndGraph.BarChart:AddBarToChart(Double, Double, Double, Double, String, String, Int32, Int32) (at Assets/Chart and Graph/Script/BarChart/BarChart.cs:605)
ChartAndGraph.BarChart:AddRowToChartMesh(Double[,], Int32, Double, Double) (at Assets/Chart and Graph/Script/BarChart/BarChart.cs:730)
ChartAndGraph.BarChart:GenerateChart() (at Assets/Chart and Graph/Script/BarChart/BarChart.cs:804)
ChartAndGraph.BarChart:MDataSource_DataStructureChanged(Object, EventArgs) (at Assets/Chart and Graph/Script/BarChart/BarChart.cs:349)
ChartAndGraph.DataSource.ChartDataSourceBase:OnDataStructureChanged() (at Assets/Chart and Graph/Script/DataSource/ChartDataSourceBase.cs:35)
ChartAndGraph.ChartSparseDataSource:ItemRemoved(IDataItem) (at Assets/Chart and Graph/Script/DataSource/ChartSparseDataSource.cs:239)
ChartAndGraph.ChartSparseDataSource:Columns_ItemRemoved(ChartDataColumn) (at Assets/Chart and Graph/Script/DataSource/ChartSparseDataSource.cs:251)
ChartAndGraph.ChartDataSourceBaseCollection`1:Remove(T) (at Assets/Chart and Graph/Script/DataSource/ChartDataSourceBaseCollection.cs:162)
ChartAndGraph.BarData:RemoveCategory(String) (at Assets/Chart and Graph/Script/BarChart/BarData.cs:327)

What we’re trying to do is to clear all categories and groups dynamically and set them again when data gets updated…

This error is fixed , please provide your email for a hot fix. or contact me at support@prosourcelabs.com

An example of how to load graph data from a database:
In this example that data contains two columns , x and y.
first you should execute an sqlCommand and obtain the data , then use it like this :

        SqlDataReader reader = command.ExecuteReader();
        graphChart = GetComponent<GraphChart>();
        while (reader.Read())
        {
            double x = reader.GetDouble(0);
            double y = reader.GetDouble(1);
            chart.DataSource.AddPointToCategory("MyCategory", x, y);
        }

Hello,

Does this plugin offers a solution for scrollable graphs? I need to be able to scroll on the X axis - I have a large amount of data and if I display everything in one screen, it will be very crowded.

Thanks,
Daniel

Hi There.
For the canvas graph this is possible by adding the graph into a scrollable ui container. For the 3d graph this is not supported. I will take this note however , since this is a feature i was thinking of adding. Thank you for your feedback.

Hi Team,
I found this unity asset on Unity Asset Store - The Best Assets for Game Making and want to use for an app development in Hololens.

I wanted to confirm from you if an app developed in Unity using this asset and exported to HoloLens / Windows platform would work as expected and not have any issues.

I ask this question as I had similar build issues with another Asset package on Unity not being compatible when exported to windows / HoloLens based platform.

I had several customers using Hololens, However i do not own hololens so I did not test it myself, If any problem will arise feel free to contact me on support@prosourcelabs.com . I can either fix it , or if for some reason you can’t use it on hololens I can refund you.
Edit : Hololens is fully supported

HI:

I wanna use 3D Chart in 3D space. But those label (item label, category label…ets) can’t fixed on 3D coordinate. Always move with camera. How can I do?