Repository: gradio-app/gradio

Issue:
Time series with decimal numbers
- [x] I have searched to see if a similar issue already exists.


**Is your feature request related to a problem? Please describe.**  
It seems currently time series component only works with integer values.

**Describe the solution you'd like**  
Add support for decimal values.

**Additional context**  



Discussion:
Do you have some example data or a simple repro that, I could test this with?

Resolving patch:
diff --git a/demo/kitchen_sink/run.py b/demo/kitchen_sink/run.py
--- a/demo/kitchen_sink/run.py
+++ b/demo/kitchen_sink/run.py
@@ -41,9 +41,13 @@ def fn(
         },  # Label
         (audio1[0], np.flipud(audio1[1]))
         if audio1 is not None
-        else os.path.join(os.path.dirname(__file__),"files/cantina.wav"),  # Audio
-        np.flipud(im1) if im1 is not None else os.path.join(os.path.dirname(__file__),"files/cheetah1.jpg"),  # Image
-        video if video is not None else os.path.join(os.path.dirname(__file__),"files/world.mp4"),  # Video
+        else os.path.join(os.path.dirname(__file__), "files/cantina.wav"),  # Audio
+        np.flipud(im1)
+        if im1 is not None
+        else os.path.join(os.path.dirname(__file__), "files/cheetah1.jpg"),  # Image
+        video
+        if video is not None
+        else os.path.join(os.path.dirname(__file__), "files/world.mp4"),  # Video
         [
             ("The", "art"),
             ("quick brown", "adj"),
@@ -73,11 +77,19 @@ def fn(
         "<button style='background-color: red'>Click Me: "
         + radio
         + "</button>",  # HTML
-        os.path.join(os.path.dirname(__file__),"files/titanic.csv"),
+        os.path.join(os.path.dirname(__file__), "files/titanic.csv"),
         df1,  # Dataframe
         np.random.randint(0, 10, (4, 4)),  # Dataframe
         [
-            im for im in [im1, im2, im3, im4, os.path.join(os.path.dirname(__file__),"files/cheetah1.jpg")] if im is not None
+            im
+            for im in [
+                im1,
+                im2,
+                im3,
+                im4,
+                os.path.join(os.path.dirname(__file__), "files/cheetah1.jpg"),
+            ]
+            if im is not None
         ],  # Carousel
         df2,  # Timeseries
     )
@@ -106,7 +118,7 @@ def fn(
         gr.Audio(label="Microphone", source="microphone"),
         gr.File(label="File"),
         gr.Dataframe(label="Dataframe", headers=["Name", "Age", "Gender"]),
-        gr.Timeseries(x="time", y=["price", "value"]),
+        gr.Timeseries(x="time", y=["price", "value"], colors=["pink", "purple"]),
     ],
     outputs=[
         gr.Textbox(label="Textbox"),
@@ -137,16 +149,16 @@ def fn(
             ["foo", "baz"],
             "baz",
             "bar",
-            os.path.join(os.path.dirname(__file__),"files/cheetah1.jpg"),
-            os.path.join(os.path.dirname(__file__),"files/cheetah1.jpg"),
-            os.path.join(os.path.dirname(__file__),"files/cheetah1.jpg"),
-            os.path.join(os.path.dirname(__file__),"files/cheetah1.jpg"),
-            os.path.join(os.path.dirname(__file__),"files/world.mp4"),
-            os.path.join(os.path.dirname(__file__),"files/cantina.wav"),
-            os.path.join(os.path.dirname(__file__),"files/cantina.wav"),
-            os.path.join(os.path.dirname(__file__),"files/titanic.csv"),
+            os.path.join(os.path.dirname(__file__), "files/cheetah1.jpg"),
+            os.path.join(os.path.dirname(__file__), "files/cheetah1.jpg"),
+            os.path.join(os.path.dirname(__file__), "files/cheetah1.jpg"),
+            os.path.join(os.path.dirname(__file__), "files/cheetah1.jpg"),
+            os.path.join(os.path.dirname(__file__), "files/world.mp4"),
+            os.path.join(os.path.dirname(__file__), "files/cantina.wav"),
+            os.path.join(os.path.dirname(__file__), "files/cantina.wav"),
+            os.path.join(os.path.dirname(__file__), "files/titanic.csv"),
             [[1, 2, 3], [3, 4, 5]],
-            os.path.join(os.path.dirname(__file__),"files/time.csv"),
+            os.path.join(os.path.dirname(__file__), "files/time.csv"),
         ]
     ]
     * 3,
diff --git a/gradio/components.py b/gradio/components.py
--- a/gradio/components.py
+++ b/gradio/components.py
@@ -2242,6 +2242,7 @@ def __init__(
         y: str | List[str] = None,
         label: Optional[str] = None,
         css: Optional[Dict] = None,
+        colors: List[str] = None,
         **kwargs,
     ):
         """
@@ -2250,6 +2251,7 @@ def __init__(
         x (str): Column name of x (time) series. None if csv has no headers, in which case first column is x series.
         y (Union[str, List[str]]): Column name of y series, or list of column names if multiple series. None if csv has no headers, in which case every column after first is a y series.
         label (str): component name in interface.
+        colors List[str]: an ordered list of colors to use for each line plot
         """
         self.default_value = (
             pd.read_csv(default_value) if default_value is not None else None
@@ -2258,6 +2260,7 @@ def __init__(
         if isinstance(y, str):
             y = [y]
         self.y = y
+        self.colors = colors
         super().__init__(label=label, css=css, **kwargs)
 
     def get_template_context(self):
@@ -2265,6 +2268,7 @@ def get_template_context(self):
             "x": self.x,
             "y": self.y,
             "default_value": self.default_value,
+            "colors": self.colors,
             **super().get_template_context(),
         }
 


Test patch:
diff --git a/test/test_components.py b/test/test_components.py
--- a/test/test_components.py
+++ b/test/test_components.py
@@ -1080,6 +1080,7 @@ def test_component_functions(self):
                 "name": "timeseries",
                 "show_label": True,
                 "label": "Upload Your Timeseries",
+                "colors": None,
                 "css": {},
                 "default_value": None,
                 "interactive": None,
@@ -1101,6 +1102,7 @@ def test_component_functions(self):
                 "name": "timeseries",
                 "show_label": True,
                 "label": "Disease",
+                "colors": None,
                 "css": {},
                 "default_value": None,
                 "interactive": None,