How to create an <img> tag in tooltip using names from the csv data file

MareeA

I have a scatter plot graph of document filings over time.
I have a tooltip box that pops up on mouseover of the data points, that provides text data. I would like to include an image in each tooltip box.
The data is drawn from a .csv file that includes a number of fields such as DocName, FilingDate, DocNumber, etc.
The images are each saved in an "Images" folder as DocNumber.jpg.
I was trying to cobble together a piece of code that would pick up the DocNumber from the csv file and create the correct html tag to make the image show up....
So far all I've managed to get is a "placeholder" .
Can someone tell me what I've done wrong?
The code for the mouseover is below:

 .on("mouseover", function(d) {      
        div.transition()        
            .duration(200)      
            .style("opacity", .9);      
        div .html(d.CCode + " " +d.DocNumber + "<br>" 
         +d.DocName + "<br>"
         + "Filing Date =" + formatTime(d.FilingDate) + "<br>"
         + "Status=" + d.Status + "<br>" 
         + '"<img src=/Images/"'+d.DocNumber+'".jpeg>"')  
            .style("left", (d3.event.pageX +10) + "px")     
            .style("top", (d3.event.pageY -28) + "px");    
        })                  
Ahmer Saeed

Description

Remove the single quotes around image tag and also before and after d.DocNumber. Following is the modified code snippet you my apply this.

Code

  .on("mouseover", function (d) {
     div.transition()
      .duration(200)
      .style("opacity", .9);
     div.html(d.CCode + " " + d.DocNumber + "<br>"
      + d.DocName + "<br>"
      + "Filing Date =" + formatTime(d.FilingDate) + "<br>"
      + "Status=" + d.Status + "<br>"
      + "<img src=/Images/" + d.DocNumber + ".jpeg>")
     .style("left", (d3.event.pageX + 10) + "px")
     .style("top", (d3.event.pageY - 28) + "px");
  });

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

How to create a graph using a CSV File data?

From Dev

Extracting variable names and data from csv file using Python

From Dev

Extracting variable names and data from csv file using Python

From Dev

How to retrieve rows from a csv file using a tag string

From Dev

Using CSV header names from one file to create new file with different headers name

From Dev

How do I create and append data from csv file to big query and partition the table using python?

From Dev

How to display non-graphed data from CSV file in Highcharts' tooltip?

From Dev

How to create an .img file from .iso on Ubuntu?

From Dev

How to create an .img file from .iso on Ubuntu?

From Dev

How can I create a CSV file from a directory listing with multiple columns based on the file names?

From Dev

how to create 1 gb csv file with random data using python

From Dev

How to extract data from .csv file and create a plot?

From Dev

How to create a CSV file from Core Data (swift)

From Dev

Load images using html <img> tag from Android expansion file

From Dev

Use data from img tag

From Dev

How to use the IMG tag from an XML file structure

From Dev

How to find data-src of Img tag using Class Name

From Dev

Create XLS or CSV from file names in folder on Windows?

From Dev

How to export data from Cassandra to CSV file using Java

From Dev

how to export data from postgresql to .csv file using jdbc?

From Dev

How to load data from a csv file into a table using Teradata Studio

From Dev

How to copy data from csv file & paste into powerpoint using vba

From Dev

how to save data from csv file to database using php

From Dev

How to remove inline style from img tag using JQuery?

From Dev

XDK - How to load an image from an URL in android using img tag

From Dev

How to remove inline style from img tag using JQuery?

From Dev

How to output an IMG tag from XML using XSLT

From Dev

How to get the img elements from within a div tag using JavaScript?

From Dev

How to create a CSV file from a XML file

Related Related

  1. 1

    How to create a graph using a CSV File data?

  2. 2

    Extracting variable names and data from csv file using Python

  3. 3

    Extracting variable names and data from csv file using Python

  4. 4

    How to retrieve rows from a csv file using a tag string

  5. 5

    Using CSV header names from one file to create new file with different headers name

  6. 6

    How do I create and append data from csv file to big query and partition the table using python?

  7. 7

    How to display non-graphed data from CSV file in Highcharts' tooltip?

  8. 8

    How to create an .img file from .iso on Ubuntu?

  9. 9

    How to create an .img file from .iso on Ubuntu?

  10. 10

    How can I create a CSV file from a directory listing with multiple columns based on the file names?

  11. 11

    how to create 1 gb csv file with random data using python

  12. 12

    How to extract data from .csv file and create a plot?

  13. 13

    How to create a CSV file from Core Data (swift)

  14. 14

    Load images using html <img> tag from Android expansion file

  15. 15

    Use data from img tag

  16. 16

    How to use the IMG tag from an XML file structure

  17. 17

    How to find data-src of Img tag using Class Name

  18. 18

    Create XLS or CSV from file names in folder on Windows?

  19. 19

    How to export data from Cassandra to CSV file using Java

  20. 20

    how to export data from postgresql to .csv file using jdbc?

  21. 21

    How to load data from a csv file into a table using Teradata Studio

  22. 22

    How to copy data from csv file & paste into powerpoint using vba

  23. 23

    how to save data from csv file to database using php

  24. 24

    How to remove inline style from img tag using JQuery?

  25. 25

    XDK - How to load an image from an URL in android using img tag

  26. 26

    How to remove inline style from img tag using JQuery?

  27. 27

    How to output an IMG tag from XML using XSLT

  28. 28

    How to get the img elements from within a div tag using JavaScript?

  29. 29

    How to create a CSV file from a XML file

HotTag

Archive