The Web Design Group

... Making the Web accessible to all.

Welcome Guest ( Log In | Register )

2 Pages V  1 2 >  
Reply to this topicStart new topic
> Chart in HTML CSS, Astrological chart
sujatha
post Nov 18 2023, 09:27 AM
Post #1





Group: Members
Posts: 4
Joined: 18-November 23
Member No.: 29,091



I want to make chart using html css design, I have attached design I tried table, tr, td, it didn't work since it is combination of square and triangle. Is there any way to make this design happen? After this code design, i will take care of value passing to all squares and triangles. I need just that diagram code or support. Thanks for your support.



Attached thumbnail(s)
Attached Image
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Jason Knight
post Nov 18 2023, 06:12 PM
Post #2


Advanced Member
****

Group: Members
Posts: 103
Joined: 25-December 22
Member No.: 28,719



What makes that image a "chart"? What's the DATA? What are the semantic relationships of your data-points to each-other?

HTML is for saying what things are, not what they look like. CSS is appearance, but ... well, I'm guessing but I think whatever you are trying to do is beyond its capabilities.

This might be SVG or maybe JavaScript + <canvas>'s job.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Christian J
post Nov 18 2023, 08:20 PM
Post #3


.
********

Group: WDG Moderators
Posts: 9,661
Joined: 10-August 06
Member No.: 7



I suppose it's an Indian astrological chart, something I alas know nothing about.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
pandy
post Nov 19 2023, 07:53 AM
Post #4


🌟Computer says no🌟
********

Group: WDG Moderators
Posts: 20,733
Joined: 9-August 06
Member No.: 6



How did Meyer create that chistmas tree again? But I assume the rhombi will be filled with content, so probably whatever method he used wouldn't work.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Christian J
post Nov 19 2023, 08:57 AM
Post #5


.
********

Group: WDG Moderators
Posts: 9,661
Joined: 10-August 06
Member No.: 7



Maybe an image map could be used?
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
CharlesEF
post Nov 19 2023, 12:56 PM
Post #6


Programming Fanatic
********

Group: Members
Posts: 1,981
Joined: 27-April 13
From: Edinburg, Texas
Member No.: 19,088



Could CSS help with this?

CODE
table
{
  transform: rotate(45deg);
}
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
pandy
post Nov 19 2023, 09:32 PM
Post #7


🌟Computer says no🌟
********

Group: WDG Moderators
Posts: 20,733
Joined: 9-August 06
Member No.: 6



I think it could! And assuming the content should not be tilted it could be rotated back again. Not the TDs, because the borders are needed, but a DIV or something inside the TDs. But how to crop the not needed bits off in a not too nasty way?
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
sujatha
post Nov 20 2023, 02:31 AM
Post #8





Group: Members
Posts: 4
Joined: 18-November 23
Member No.: 29,091



Thanks for all your feed backs, yes it is North Indian style Astrological Chart. Nodejs generated Data is ready to pass on each square and triangle. I already created south indian hora chart using table successfully. Just need html , css diagram for that.
Thanks,
Sujatha
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
pandy
post Nov 20 2023, 05:01 PM
Post #9


🌟Computer says no🌟
********

Group: WDG Moderators
Posts: 20,733
Joined: 9-August 06
Member No.: 6



Could you show us how a complete chart with data looks? An image would be fine. Just want to get a grip of how it looks.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
pandy
post Nov 20 2023, 05:49 PM
Post #10


🌟Computer says no🌟
********

Group: WDG Moderators
Posts: 20,733
Joined: 9-August 06
Member No.: 6



OK, using CharlesEF's idea, I came up with this. It's messy, but I can't think of another way. And I haven't figured out how to put a border around the whole thing - I think there is one in your image. I'd still like to see how the content looks. Maybe it isn't needed to rotate it back.

Note that when the table is rotated it sticks out of the box, so to speak. It even sticks out of the viewport. Hence the margins. This may make it hard to place on the page.

CODE

table    { transform: rotate(45deg);
           empty-cells: show;
           border-collapse: collapse;
           margin: 10em 0 0 10em }

td       { border: 2px solid;
           width: 6em; height: 6em }

td div   { transform: rotate(-45deg) }

#a .a    { border: none }
#a .b    { border-style: none solid solid none }
#a .c    { border-style: none none solid solid }
#a .d    { border: none }

#b .a    { border-style: none solid solid none }
#b .d    { border-style: none none solid solid }

#c .a    { border-style: solid solid none none }
#c .d    { border-style: solid none none solid }

#d .a    { border-style: none }
#d .b    { border-style: solid solid none none }
#d .c    { border-style: solid none none none }
#d .d    { border-style: none }


HTML
<table>
<tr id="a">
<td class="a"></td>
<td class="b"></td>
<td class="c"></td>
<td class="d"></td>
</tr>
<tr id="b">
<td class="a"></td>
<td><div>qwerty</div></td>
<td><div>qwerty</div></td>
<td class="d"></td>
</tr>
<tr id="c">
<td class="a"></td>
<td><div>qwerty</div></td>
<td><div>qwerty</div></td>
<tdv class="d"></td>
</tr>
<tr id="d">
<td class="a"></td>
<td class="b"></td>
<td class="c"></td>
<td class="d"></td>
</tr>
</table>


Attached Image
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
sujatha
post Nov 21 2023, 07:51 AM
Post #11





Group: Members
Posts: 4
Joined: 18-November 23
Member No.: 29,091



Thank you so much for all your support putting together. I am sending code for south indian chart as you are interested, i may change height width later with little updates...

#######HTML ##########
<h4>South Indian Chart</h4>
<table className="tableA">
<tr>
<td id='Pi'>{PiVal}</td><td id='Ar'>{ArVal}</td><td id='Ta'>{TaVal}</td><td id='Ge'>{GeVal}</td>
</tr>
<tr>
<td id='Aq'>{AqVal}</td><td className="col">Rasi Chart</td><td></td><td id='Ca'>{CnVal}</td>
</tr>
<tr>
<td id='Ca'>{CpVal}</td><td></td><td className="col1"></td><td id='Le'>{LeVal}</td>
</tr>
<tr>
<td id='Sa'>{SgVal}</td><td id='Sc'>{ScVal}</td><td id='Li'>{LiVal}</td><td id='Vi'>{ViVal}</td>
</tr>
</table>

########### CSS###########
.col {
border-right: hidden;
border-bottom: hidden;
}
.col1 {
border-left: hidden;
border-top: hidden;
}
.tableA {
border-collapse: collapse;
/* border: 2px solid #ff4d00;*/
background-color:rgb(244, 244, 216);

inline-size: 2px solid;
height: 400px;
width: 600px;
margin-left: 10%;
&td, th, tr{
border: 1px solid #402cef;
text-align: center;
table-layout: left;
font-size: 15px;
}}
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
coothead
post Nov 21 2023, 11:05 AM
Post #12


Advanced Member
****

Group: Members
Posts: 206
Joined: 12-January 23
From: chertsey, a small town 25 miles south west of london, england
Member No.: 28,743



Hi there sujatha,

check out the attachment below to see a fully responsive example. IPB Image

Attached File  North_Indian_Astrological_Chart.zip ( 1.47k ) Number of downloads: 224




coothead
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
CharlesEF
post Nov 21 2023, 08:08 PM
Post #13


Programming Fanatic
********

Group: Members
Posts: 1,981
Joined: 27-April 13
From: Edinburg, Texas
Member No.: 19,088



QUOTE(coothead @ Nov 21 2023, 10:05 AM) *

Hi there sujatha,

check out the attachment below to see a fully responsive example. IPB Image
Attached File  North_Indian_Astrological_Chart.zip ( 1.47k ) Number of downloads: 224


coothead

Looks good to me but what do I know? Nice job.

This post has been edited by CharlesEF: Nov 21 2023, 08:09 PM
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
coothead
post Nov 22 2023, 01:35 PM
Post #14


Advanced Member
****

Group: Members
Posts: 206
Joined: 12-January 23
From: chertsey, a small town 25 miles south west of london, england
Member No.: 28,743



QUOTE(CharlesEF @ Nov 22 2023, 02:08 AM) *


...but what do I know?



Well, hopefully, you now know how useful SVG can be for this type of task. IPB Image

Also. you might have noticed that our resident coding guru - Jason Knight
had actually suggested it's possible suitability earlier in this thread. IPB Image


coothead
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
pandy
post Nov 23 2023, 02:27 PM
Post #15


🌟Computer says no🌟
********

Group: WDG Moderators
Posts: 20,733
Joined: 9-August 06
Member No.: 6



Looks good, but I thought the purpose was to have some kind of structure. The text can't be copied and the chart can't be printed either. That could be problematic, I think,
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
pandy
post Nov 23 2023, 02:31 PM
Post #16


🌟Computer says no🌟
********

Group: WDG Moderators
Posts: 20,733
Joined: 9-August 06
Member No.: 6



QUOTE(sujatha @ Nov 21 2023, 01:51 PM) *

Thank you so much for all your support putting together. I am sending code for south indian chart as you are interested, i may change height width later with little updates...


I meant I wanted to actually see the content. But I googled and know now it's just text, and horizontal at that. At least the charts I found looked like that.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
CharlesEF
post Nov 23 2023, 02:58 PM
Post #17


Programming Fanatic
********

Group: Members
Posts: 1,981
Joined: 27-April 13
From: Edinburg, Texas
Member No.: 19,088



QUOTE(coothead @ Nov 22 2023, 12:35 PM) *

QUOTE(CharlesEF @ Nov 22 2023, 02:08 AM) *

...but what do I know?

Well, hopefully, you now know how useful SVG can be for this type of task. IPB Image

Also. you might have noticed that our resident coding guru - Jason Knight
had actually suggested it's possible suitability earlier in this thread. IPB Image

coothead

To be honest, in all my years of programming I've never had the need to use an SVG. So, I know nothing about it.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
coothead
post Nov 23 2023, 03:21 PM
Post #18


Advanced Member
****

Group: Members
Posts: 206
Joined: 12-January 23
From: chertsey, a small town 25 miles south west of london, england
Member No.: 28,743



QUOTE(pandy @ Nov 23 2023, 08:27 PM) *


...but I thought the purpose was to have some kind of structure.



Well, the svg element which I used may be considered as equivalent to
your table element and the path element may, likewise, be considered
as equivalent to your td element.

Also note that all the content items of the chart may be positioned
precisely in the totally responsive container.

Personally, I believe that using SVG is the perfect solution to the
O.P.'s problem.


coothead
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
coothead
post Nov 23 2023, 03:32 PM
Post #19


Advanced Member
****

Group: Members
Posts: 206
Joined: 12-January 23
From: chertsey, a small town 25 miles south west of london, england
Member No.: 28,743



QUOTE(CharlesEF @ Nov 23 2023, 08:58 PM) *


To be honest, in all my years of programming I've never had the need to use an SVG.



Luckily for you, it seems that you have never needed to code a...
North Indian Astrological Chart. IPB Image

coothead
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
coothead
post Nov 23 2023, 03:53 PM
Post #20


Advanced Member
****

Group: Members
Posts: 206
Joined: 12-January 23
From: chertsey, a small town 25 miles south west of london, england
Member No.: 28,743



QUOTE(pandy @ Nov 23 2023, 08:27 PM) *


The text can't be copied



The text from each "House" may be copied

QUOTE(pandy @ Nov 23 2023, 08:27 PM) *


and the chart can't be printed either.



So, what is wrong with taking an image?

Attached Image


coothead
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post

2 Pages V  1 2 >
Reply to this topicStart new topic
4 User(s) are reading this topic (4 Guests and 0 Anonymous Users)
0 Members:

 



- Lo-Fi Version Time is now: 27th April 2024 - 05:56 AM