mattosaurus / ChartJSCore

Implementation of Chart.js for use with .NET Core.
GNU General Public License v3.0
116 stars 34 forks source link

How to add two diferent objects into YAxes (Scale) list? #61

Closed Marlohn closed 3 years ago

Marlohn commented 4 years ago

Im trying to add two diferent objects into YAxes (Scale) list but it appears dont works.

If I try to add just any one separated it works fine!

            YAxes = new List<Scale>{
                new BarScale
                {
                    GridLines = new GridLine()
                    {
                        Display = false,
                        DrawBorder = false
                    }

                },
                new CartesianScale
                {
                    Ticks = new CartesianLinearTick
                    {
                        Display = false
                    }
                }
            }

I think this is a problem with Newtonsoft.Json that cant serialize diferent types of objects in a Inheritance list

mattosaurus commented 4 years ago

Hi, yeah, I think this is a serialization issue. I'm not really sure how we'd get around this, any ideas?