Beispiel #1
0
        public static void For <T>(object config, SeriesOrientation orientation = SeriesOrientation.All)
        {
            ConfigWrapper wrapper;
            var           t = typeof(T);

            if (!Configurations.TryGetValue(t, out wrapper))
            {
                wrapper           = new ConfigWrapper();
                Configurations[t] = wrapper;
            }

            if (orientation == SeriesOrientation.All)
            {
                wrapper.VerticalConfig   = config;
                wrapper.HorizontalConfig = config;

                return;
            }

            if (orientation == SeriesOrientation.Horizontal)
            {
                wrapper.HorizontalConfig = config;
            }
            else
            {
                wrapper.VerticalConfig = config;
            }
        }
Beispiel #2
0
        public object GetConfig <T>(SeriesOrientation orientation = SeriesOrientation.Horizontal)
        {
            var wrapper = Configurations[typeof(T)];

            return(orientation == SeriesOrientation.Horizontal || orientation == SeriesOrientation.All
                ? wrapper.HorizontalConfig
                : wrapper.VerticalConfig);
        }
Beispiel #3
0
        public object GetConfig <T>(SeriesOrientation orientation = SeriesOrientation.Horizontal)
        {
            ConfigWrapper wrapper;

            if (!Configurations.TryGetValue(typeof(T), out wrapper))
            {
                throw new LiveChartsException("LiveCharts does not know how to plot " + typeof(T).Name + ", " +
                                              "you can either, use an already configured type " +
                                              "or configure this type you are trying to use, " +
                                              "For more info see " +
                                              "http://lvcharts.net/App/examples/v1/wpf/Types%20and%20Configuration");
            }

            return(orientation == SeriesOrientation.Horizontal || orientation == SeriesOrientation.All
                ? wrapper.HorizontalConfig
                : wrapper.VerticalConfig);
        }